From 3d1f53ed2ee773b3a04e09551ca87926f9977308 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Tue, 9 Jul 2024 20:00:20 -0400 Subject: [PATCH] Make the aggregate jobs end with -aggregate so we don't build those --- .github/workflows/matrix.sh | 1 + nix/tests/vm-test/default.nix | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/matrix.sh b/.github/workflows/matrix.sh index 7a2dd8aea..9262bd0fd 100755 --- a/.github/workflows/matrix.sh +++ b/.github/workflows/matrix.sh @@ -17,6 +17,7 @@ nix flake show --json --all-systems \ map(select(.[0][-1] == "type" and .[1] == "derivation") | .[0][0:-1] # Take each attribute name and drop `type` | select(.[-1] != "all") # Skip attributes which are `all` jobs, presumably combining other jobs + | select(.[-1] | endswith("-aggregate") != true) # Skip attributes which end in `-aggregate`, because those just depend on other jobs which build them | select(.[0] == "hydraJobs") # Select the hydraJobs which are not typically run in CI | { attribute: . | join("."), diff --git a/nix/tests/vm-test/default.nix b/nix/tests/vm-test/default.nix index 63eb2a543..613574044 100644 --- a/nix/tests/vm-test/default.nix +++ b/nix/tests/vm-test/default.nix @@ -600,7 +600,7 @@ let touch $out ''; - makeTests = name: tests: builtins.mapAttrs + makeTests = name: tests: imagePredicate: builtins.mapAttrs (imageName: image: rec { ${image.system} = (builtins.mapAttrs @@ -608,7 +608,7 @@ let makeTest imageName testName test ) tests) // { - "${name}" = (with (forSystem "x86_64-linux" ({ system, pkgs, ... }: pkgs)); pkgs.releaseTools.aggregate { + "${name}-aggregate" = (with (forSystem "x86_64-linux" ({ system, pkgs, ... }: pkgs)); pkgs.releaseTools.aggregate { name = name; constituents = ( pkgs.lib.mapAttrsToList @@ -621,17 +621,17 @@ let }; } ) - images; + (lib.filterAttrs imagePredicate images); allCases = lib.recursiveUpdate (lib.recursiveUpdate installCases (lib.recursiveUpdate cureSelfCases cureScriptCases)) uninstallCases; - install-tests = makeTests "install" installCases; + install-tests = makeTests "install" installCases (_: _: true); - cure-self-tests = makeTests "cure-self" cureSelfCases; + cure-self-tests = makeTests "cure-self" cureSelfCases (_: _: true); - cure-script-tests = makeTests "cure-script" cureScriptCases; + cure-script-tests = makeTests "cure-script" cureScriptCases (_name: { upstreamScriptsWork ? true, ... }: upstreamScriptsWork); - uninstall-tests = makeTests "uninstall" uninstallCases; + uninstall-tests = makeTests "uninstall" uninstallCases (_: _: true); all-tests = builtins.mapAttrs (imageName: image: { @@ -652,7 +652,7 @@ in lib.recursiveUpdate joined-tests { all."x86_64-linux" = (with (forSystem "x86_64-linux" ({ system, pkgs, ... }: pkgs)); pkgs.lib.mapAttrs (caseName: case: pkgs.releaseTools.aggregate { - name = caseName; + name = "${caseName}-aggregate"; constituents = pkgs.lib.mapAttrsToList (name: value: value."x86_64-linux"."${caseName}") joined-tests; } )) (allCases // { "cure-self" = { }; "cure-script" = { }; "install" = { }; "uninstall" = { }; "all" = { }; });