1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

tests: forward only test chunks to buildbot

We currently only need the tests covered by test-chunks in CI. We will
migrate more tests into the buildbot CI, as we are able to flesh them
out more.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman 2025-07-27 22:17:19 -05:00
parent 7a02711a61
commit 800f16a9c5

View file

@ -26,40 +26,11 @@
"x86_64-linux" "x86_64-linux"
]; ];
tests = ciTestChunks =
system: system:
let let
inherit (pkgs) lib;
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
inherit (pkgs) lib;
integrationTestPackages =
let
tests = import ./integration {
inherit pkgs;
inherit (pkgs) lib;
};
renameTestPkg = n: lib.nameValuePair "integration-test-${n}";
in
lib.mapAttrs' renameTestPkg tests;
testAllNoBig =
let
tests = import ./. {
inherit pkgs;
enableBig = false;
};
in
lib.nameValuePair "test-all-no-big" tests.build.all;
testAllNoBigIfd =
let
tests = import ./. {
inherit pkgs;
enableBig = false;
enableLegacyIfd = true;
};
in
lib.nameValuePair "test-all-no-big-ifd" tests.build.all;
# Create chunked test packages for better CI parallelization # Create chunked test packages for better CI parallelization
testChunks = testChunks =
@ -98,16 +69,65 @@
) numChunks ) numChunks
); );
in in
integrationTestPackages testChunks;
// testChunks
allPackagesAndTests =
system:
let
pkgs = nixpkgs.legacyPackages.${system};
inherit (pkgs) lib;
renamedBuildTests =
let
tests = import ./. { inherit pkgs; };
renameTestPkg = n: lib.nameValuePair "test-${n}";
in
lib.mapAttrs' renameTestPkg tests.build;
integrationTestPackages =
let
tests = import ./integration {
inherit pkgs;
inherit (pkgs) lib;
};
renameTestPkg = n: lib.nameValuePair "integration-test-${n}";
in
lib.mapAttrs' renameTestPkg tests;
# Aggregate test set without big tests
testAllNoBig =
let
tests = import ./. {
inherit pkgs;
enableBig = false;
};
in
lib.nameValuePair "test-all-no-big" tests.build.all;
# Aggregate test set without big tests, with legacy IFD
testAllNoBigIfd =
let
tests = import ./. {
inherit pkgs;
enableBig = false;
enableLegacyIfd = true;
};
in
lib.nameValuePair "test-all-no-big-ifd" tests.build.all;
in
# Merge all the packages and tests meant for the 'packages' output
renamedBuildTests
// integrationTestPackages
// (lib.listToAttrs [ // (lib.listToAttrs [
testAllNoBig testAllNoBig
testAllNoBigIfd testAllNoBigIfd
]); ])
// (ciTestChunks system);
in in
{ {
buildbot = forCI (system: tests system); # TODO: increase buildbot testing scope
buildbot = forCI ciTestChunks;
devShells = forAllSystems ( devShells = forAllSystems (
system: system:
@ -118,22 +138,6 @@
tests.run tests.run
); );
packages = forAllSystems ( packages = forAllSystems allPackagesAndTests;
system:
let
inherit (pkgs) lib;
pkgs = nixpkgs.legacyPackages.${system};
# testPackages: only included in packages
testPackages =
let
tests = import ./. { inherit pkgs; };
renameTestPkg = n: lib.nameValuePair "test-${n}";
in
lib.mapAttrs' renameTestPkg tests.build;
in
testPackages // tests system
);
}; };
} }