tests: group tests by 10

Attempt to find a middle ground between having a single link-farm and
one test per file.

This groups up to ten tests per (roughly) 28 link-farms.
This commit is contained in:
Matt Sturgeon 2024-08-19 01:11:10 +01:00
parent 8f99c3953c
commit 69c2fa866e
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -37,10 +37,9 @@ let
};
in
# We attempt to build & execute all configurations
builtins.listToAttrs (
builtins.map (
{ name, cases }:
lib.pipe (testFiles ++ [ exampleFiles ]) [
(builtins.map (
file:
let
# The test case can either be the actual definition,
# or a child attr named `module`.
@ -59,8 +58,16 @@ builtins.listToAttrs (
};
in
{
name = "test-${name}";
value = pkgs.linkFarm "test-${name}" (lib.map mkTest cases);
inherit (file) name;
path = pkgs.linkFarm file.name (builtins.map mkTest file.cases);
}
) (testFiles ++ [ exampleFiles ])
)
))
(helpers.groupListBySize 10)
(lib.imap1 (
i: group: rec {
name = "test-${toString i}";
value = pkgs.linkFarm name group;
}
))
builtins.listToAttrs
]