flake-modules/devshell: update tests command with link-farm support

Since we're using link-farms, we need to access the underlying tests as
`passthru.entries.*`.
This commit is contained in:
Matt Sturgeon 2024-08-19 03:55:56 +01:00
parent 69c2fa866e
commit 312db6b6e2
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
2 changed files with 40 additions and 5 deletions

View file

@ -7,6 +7,7 @@
lib,
pkgs,
config,
self',
system,
...
}:
@ -44,9 +45,27 @@
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}.passthru.entries.${testName}";
}) (builtins.attrNames checks'.${checkName}.passthru.entries)
) names
);
in
''
NIXVIM_SYSTEM=${system} NIXVIM_NIX_COMMAND=${nix} ${lib.getExe launchTest} "$@"
export NIXVIM_SYSTEM=${system}
export NIXVIM_NIX_COMMAND=${nix}
export NIXVIM_TESTS=${pkgs.writers.writeJSON "tests.json" tests}
${lib.getExe launchTest} "$@"
'';
}
{