tests: use a nested attrset for buildbot

We need to optimise the buildbot attrs for nix-eval-jobs, however this
doesn't make sense for `nix flake check` or `nix flake show`.

Now that we aren't using the `checks` output, we don't _need_ to
restrict ourselves to a flat set of test derivations anymore.

This also simplifies our `tests` command, and means we no longer need to
pre-compute the test attr names.
This commit is contained in:
Matt Sturgeon 2025-07-01 01:51:58 +01:00
parent 1463ec64d5
commit db7c5364a5
3 changed files with 12 additions and 38 deletions

View file

@ -59,26 +59,10 @@
text = builtins.readFile ./launch-test.sh;
};
tests =
let
checks' = self'.checks;
names = builtins.filter (n: builtins.match "test-.*" n != null) (builtins.attrNames checks');
in
builtins.listToAttrs (
builtins.concatMap (
checkName:
map (testName: {
name = testName;
value = "${checkName}.entries.${testName}";
}) (builtins.attrNames checks'.${checkName}.entries)
) names
);
in
''
export NIXVIM_SYSTEM=${system}
export NIXVIM_NIX_COMMAND=${nix}
export NIXVIM_TESTS=${pkgs.writers.writeJSON "tests.json" tests}
${lib.getExe launchTest} "$@"
'';
}