From 04c9ee6a1b53ee3b34ed9b48c0c17c001627aa75 Mon Sep 17 00:00:00 2001 From: Mayeu Date: Sat, 9 May 2026 19:03:42 +0200 Subject: [PATCH 1/2] feat: add build action to nixostests blocktype Reuses the generic actions.build (same pattern as installables, runnables, devshells, containers). Lets downstream registries set ci.build = 1 on nixostests blocks so std-action's proviso skips targets whose test derivation is already cached, instead of re-running the VM driver every time via ci.run = 1. The interactive `run`/`run-vm`/`run-vm+` actions are unchanged. --- src/std/fwlib/blockTypes/nixostests.nix | 2 ++ tests/bt-blocktypes/expr.nix | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/std/fwlib/blockTypes/nixostests.nix b/src/std/fwlib/blockTypes/nixostests.nix index bcb7dd5c..00082e39 100644 --- a/src/std/fwlib/blockTypes/nixostests.nix +++ b/src/std/fwlib/blockTypes/nixostests.nix @@ -7,6 +7,7 @@ Use the NixosTests Blocktype in order to instrucement nixos vm-based test inside your reporisory. Available actions: + - build - run - run-vm - audit-script @@ -32,6 +33,7 @@ in inherit (pkgs.stdenv) isLinux; in [ + (actions.build currentSystem target) (mkCommand currentSystem "run" "run tests in headless vm" [] '' # ${target.driver} ${target.driver}/bin/nixos-test-driver diff --git a/tests/bt-blocktypes/expr.nix b/tests/bt-blocktypes/expr.nix index d2c3dbba..9ba079c2 100644 --- a/tests/bt-blocktypes/expr.nix +++ b/tests/bt-blocktypes/expr.nix @@ -33,6 +33,8 @@ configFile = "path/to/configFile"; }; nixostests = { + drvPath = "drvPath"; + outPath = "outPath"; driver = "driver"; driverInteractive = "driverInteractive"; }; From a37805b7205cef9bf72a71f61f1ef20d58d49e89 Mon Sep 17 00:00:00 2001 From: Mayeu Date: Sat, 9 May 2026 19:04:46 +0200 Subject: [PATCH 2/2] test: snapshot nixostests build action Updates the bt-blocktypes namaka snapshot with the new `build` entry under `nixostests.actions`. --- tests/_snapshots/bt-blocktypes | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/_snapshots/bt-blocktypes b/tests/_snapshots/bt-blocktypes index 627e4465..16e9aea9 100644 --- a/tests/_snapshots/bt-blocktypes +++ b/tests/_snapshots/bt-blocktypes @@ -255,6 +255,13 @@ }; nixostests = { actions = [ + { + command = ; + description = "build it"; + name = "build"; + proviso = "std/fwlib/actions/build-proviso.sh"; + targetDrv = "drvPath"; + } { command = ; description = "run tests in headless vm";