aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/populate/tests
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-30 19:28:06 +0000
committertv <tv@krebsco.de>2026-11-30 22:08:21 +0100
commit8a5d402e7662692fe9168c49126191b155b5f4cb (patch)
treee41a545e0f2e5b95f742c3c62a830d3006c74dca /pkgs/populate/tests
parentc8088839270c8994c0533d2fbfec7e5ade69cb57 (diff)
tests: extra.smoke, extra.only, and extra.bench, instead of smoke.smoke and so on
Diffstat (limited to 'pkgs/populate/tests')
-rw-r--r--pkgs/populate/tests/default.nix34
1 files changed, 18 insertions, 16 deletions
diff --git a/pkgs/populate/tests/default.nix b/pkgs/populate/tests/default.nix
index b5dffb0..564c67d 100644
--- a/pkgs/populate/tests/default.nix
+++ b/pkgs/populate/tests/default.nix
@@ -6,14 +6,15 @@
# nix-build in this directory, or one with, e.g., nix-build -A flake. 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 -A
-# exhaustive, or one with, e.g., nix-build -A exhaustive.flake. The smoke
-# test runs a few scenarios covering each source type and each kind of
-# target in a single VM test, for checking changes quickly; build it with
-# nix-build -A smoke. nix-build -A only --argstr only REGEX runs the
-# scenarios whose names match the regular expression REGEX in a single VM
-# test, e.g. --argstr only 'lock-hooks-.*'. nix-build -A bench times
-# populate with 100 sources, locally and with 30 ms of delay to the target;
-# the log shows how long each run takes.
+# exhaustive, or one with, e.g., nix-build -A exhaustive.flake. The tests
+# in extra, which nix-build doesn't build either, are for development: the
+# smoke test runs a few scenarios covering each source type and each kind
+# of target in a single VM test, for checking changes quickly; build it
+# with nix-build -A extra.smoke. nix-build -A extra.only --argstr only
+# REGEX runs the scenarios whose names match the regular expression REGEX
+# in a single VM test, e.g. --argstr only 'lock-hooks-.*'. nix-build -A
+# extra.bench times populate with 100 sources, locally and with 30 ms of
+# delay to the target; the log shows how long each run takes.
{ pkgs ? import <nixpkgs> {}, only ? null }:
let
@@ -112,7 +113,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
@@ -143,15 +144,16 @@ in
assert checkSourceTypes;
testsOf false ""
- # Not built by nix-build either, which runs these scenarios anyway.
+ # Attribute sets without recurseForDerivations, so nix-build doesn't build
+ # them: the tests built only on request, and the exhaustive ones.
// {
- smoke.smoke = vm "smoke" (named "smoke test" (import ./smoke.nix)) pkgs.rsync;
- only.only = vm "only" onlyScenarios pkgs.rsync;
- bench.bench = vm "bench" scenarios.bench pkgs.rsync;
+ extra = {
+ smoke = vm "smoke" (named "smoke test" (import ./smoke.nix)) pkgs.rsync;
+ only = vm "only" onlyScenarios pkgs.rsync;
+ bench = vm "bench" scenarios.bench pkgs.rsync;
+ };
+ exhaustive = testsOf true "exhaustive-";
}
- # An attribute set without recurseForDerivations, so nix-build doesn't
- # build them.
- // { exhaustive = testsOf true "exhaustive-"; }
// lib.mapAttrs'
(version: rsync: {
name = "rsync-${builtins.replaceStrings [ "." ] [ "-" ] version}";