From b5a3510bdebd7a0ce2242ad34b7be81d430b7c35 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 30 Nov 2026 14:05:37 +0000 Subject: tests: bench, timing populate with 100 sources 50 file, 30 symlink, and 20 git sources, delivered once and then twice with nothing to change, locally and to a remote target with 30 ms of delay on its interfaces, which lasts for the rest of the test. So bench is a VM test of its own, which nix-build doesn't build, like smoke. --- pkgs/populate/tests/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'pkgs/populate/tests/default.nix') diff --git a/pkgs/populate/tests/default.nix b/pkgs/populate/tests/default.nix index 9693034..b5dffb0 100644 --- a/pkgs/populate/tests/default.nix +++ b/pkgs/populate/tests/default.nix @@ -11,7 +11,9 @@ # 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-.*'. +# 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. { pkgs ? import {}, only ? null }: let @@ -82,13 +84,14 @@ let }; # VM tests of those of the groups of scenarios that are, or aren't, - # exhaustive, named after the groups with prefix in front. + # exhaustive, named after the groups with prefix in front. Not bench, + # whose delay would slow the scenarios after it. testsOf = exhaustive: prefix: lib.mapAttrs (name: scenarios: vm (prefix + name) scenarios pkgs.rsync) (lib.filterAttrs (_: scenarios: scenarios != []) (builtins.mapAttrs (_: builtins.filter (scenario: scenario.exhaustive == exhaustive)) - scenarios)); + (removeAttrs scenarios [ "bench" ]))); allScenarios = lib.concatLists (builtins.attrValues scenarios); @@ -144,6 +147,7 @@ assert checkSourceTypes; // { 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; } # An attribute set without recurseForDerivations, so nix-build doesn't # build them. -- cgit v1.3.1