diff --git a/tests/default.nix b/tests/default.nix index 48e6d877..1da61795 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -55,13 +55,28 @@ let platforms = callTests ./platforms { }; # Tests generated from ./test-sources + # As a list of { name, path } attrs + main = (callTests ./main.nix { }).tests; + + # Combined into a single link-farm derivation + mainDrv.tests = linkFarm "tests" main; + # Grouped as a number of link-farms in the form { test-1, test-2, ... test-N } - main = callTests ./main.nix { }; + mainGrouped = lib.pipe main [ + (helpers.groupListBySize 10) + (lib.imap1 ( + i: group: rec { + name = "test-${toString i}"; + value = linkFarm name group; + } + )) + builtins.listToAttrs + ]; in { # TODO: consider whether all these tests are needed in the `checks` output - flakeCheck = misc // docs // platforms // main; + flakeCheck = misc // docs // platforms // mainDrv; # TODO: consider whether all these tests are needed to be built by buildbot - buildbot = lib.optionalAttrs (system == "x86_64-linux") (misc // docs) // platforms // main; + buildbot = lib.optionalAttrs (system == "x86_64-linux") (misc // docs) // platforms // mainGrouped; } diff --git a/tests/main.nix b/tests/main.nix index cce017aa..0a69c0fe 100644 --- a/tests/main.nix +++ b/tests/main.nix @@ -1,7 +1,6 @@ # Collects the various test modules in tests/test-sources/ and groups them into a number of test derivations { callTest, - helpers, lib ? pkgs.lib, linkFarm, pkgs, @@ -69,8 +68,8 @@ let }; in # We attempt to build & execute all configurations -lib.pipe (testFiles ++ [ exampleFiles ]) [ - (builtins.map ( +{ + tests = map ( { name, file, @@ -80,13 +79,5 @@ lib.pipe (testFiles ++ [ exampleFiles ]) [ inherit name; path = linkFarm name (builtins.mapAttrs (moduleToTest file) cases); } - )) - (helpers.groupListBySize 10) - (lib.imap1 ( - i: group: rec { - name = "test-${toString i}"; - value = linkFarm name group; - } - )) - builtins.listToAttrs -] + ) (testFiles ++ [ exampleFiles ]); +}