diff options
| author | tv <tv@krebsco.de> | 2026-11-30 19:30:43 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-30 22:08:21 +0100 |
| commit | 9bd22fe7a064401e0316b7617c06cb1ead1b779e (patch) | |
| tree | 7be4cfc5f42a38fe483d39d25312f1f8d5040df5 | |
| parent | 8a5d402e7662692fe9168c49126191b155b5f4cb (diff) | |
tests: extra.smoke and extra.only, instead of smoke.smoke and only.only
| -rw-r--r-- | README.md | 8 | ||||
| -rw-r--r-- | tests/default.nix | 33 |
2 files changed, 22 insertions, 19 deletions
@@ -373,15 +373,15 @@ KVM and nixpkgs with `pkgs.testers.runNixOSTest` (23.05 or later), and use `<nixpkgs>` by default. ```sh -nix-build tests # all tests, except the exhaustive ones +nix-build tests # all tests, except exhaustive and extra nix-build tests -A deploy # the test of writeDeploy nix-build tests -A pure # the test of pure evaluation nix-build tests -A exhaustive # all exhaustive tests -nix-build tests -A smoke # a few scenarios of each, in one VM -nix-build tests -A only --argstr only 'lock-hooks-.*' # scenarios by name +nix-build tests -A extra.smoke # a few scenarios of each, in one VM +nix-build tests -A extra.only --argstr only 'lock-hooks-.*' # by name ``` -`-A only` selects from all of populate's scenarios and krops' own, all +`-A extra.only` selects from all of populate's scenarios and krops' own, all running through `pkgs.populate`. Evaluating the tests also checks that the minimal example fetches the newest version in the [changelog](CHANGELOG.md), or, with unreleased changes, one at least as new as the newest release. diff --git a/tests/default.nix b/tests/default.nix index 95f3856..b9e1057 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -4,14 +4,16 @@ # populate's scenarios that expect populate to refuse its arguments, which # pkgs.populate does during evaluation here, and the scenarios of # populate's smoke test, with target attribute sets as mkTarget returns -# them, and pure, for pure evaluation, see ./pure.nix. Build all with nix-build tests, or one with, e.g., nix-build tests -# -A deploy. The exhaustive tests add the combinations of options that no -# code path tells apart from the ones the others cover; build them with -# nix-build tests -A exhaustive. The smoke test runs a few scenarios of -# each in a single VM test; build it with nix-build tests -A smoke. -# nix-build tests -A only --argstr only REGEX runs the scenarios whose -# names match the regular expression REGEX, of all of populate's scenarios -# and krops' own, in a single VM test, e.g. --argstr only 'lock-hooks-.*'. +# them, and pure, for pure evaluation, see ./pure.nix. Build all with +# nix-build tests, or one with, e.g., nix-build tests -A deploy. The +# exhaustive tests add the combinations of options that no code path tells +# apart from the ones the others cover; build them with nix-build tests -A +# exhaustive. The tests in extra, which nix-build doesn't build either, +# are for development: the smoke test runs a few scenarios of each in a +# single VM test; build it with nix-build tests -A extra.smoke. nix-build +# tests -A extra.only --argstr only REGEX runs the scenarios whose names +# match the regular expression REGEX, of all of populate's scenarios and +# krops' own, in a single VM test, e.g. --argstr only 'lock-hooks-.*'. # populate's own tests run the program directly; see # ../pkgs/populate/README.md. { pkgs ? import ../pkgs {}, only ? null }: @@ -129,7 +131,7 @@ let allScenarios; in if only == null then - throw "tests: -A only needs --argstr only REGEX" + throw "tests: -A extra.only needs --argstr only REGEX" else if selected == [] then throw "tests: no scenario's name matches ${builtins.toJSON only}" else @@ -163,11 +165,12 @@ assert !(krops.isLocalTarget (targets.remote "/")); assert checkReadmeVersion; testsOf false "" - # Not built by nix-build tests either, which runs these scenarios anyway. + # Attribute sets without recurseForDerivations, so nix-build tests doesn't + # build them: the tests built only on request, and the exhaustive ones. // { - smoke.smoke = vm "smoke" smokeScenarios; - only.only = vm "only" onlyScenarios; + extra = { + smoke = vm "smoke" smokeScenarios; + only = vm "only" onlyScenarios; + }; + exhaustive = testsOf true "exhaustive-"; } - # An attribute set without recurseForDerivations, so nix-build tests - # doesn't build them. - // { exhaustive = testsOf true "exhaustive-"; } |
