ci/eval: eval nixosTests.simple

We can't eval all nixos tests, this would be way too expensive. But we
can evaluate `nixosTests.simple` as an indication whether the nixos test
driver has changed. If that's the case, this means that *all* NixOS
tests need to be rebuilt.

Changed files
+44 -10
ci
nixos
+15 -3
ci/eval/outpaths.nix
···
}:
let
lib = import (path + "/lib");
-
hydraJobs =
+
+
nixpkgsJobs =
import (path + "/pkgs/top-level/release.nix")
# Compromise: accuracy vs. resources needed for evaluation.
{
···
__allowFileset = false;
};
};
+
+
nixosJobs = import (path + "/nixos/release.nix") {
+
inherit attrNamesOnly;
+
supportedSystems = if systems == null then [ builtins.currentSystem ] else systems;
+
};
+
recurseIntoAttrs = attrs: attrs // { recurseForDerivations = true; };
-
# hydraJobs leaves recurseForDerivations as empty attrmaps;
+
# release-lib leaves recurseForDerivations as empty attrmaps;
# that would break nix-env and we also need to recurse everywhere.
tweak = lib.mapAttrs (
name: val:
···
];
in
-
tweak (builtins.removeAttrs hydraJobs blacklist)
+
tweak (
+
(builtins.removeAttrs nixpkgsJobs blacklist)
+
// {
+
nixosTests.simple = nixosJobs.tests.simple;
+
}
+
)
+29 -7
nixos/release.nix
···
"aarch64-linux"
],
configuration ? { },
+
+
# This flag, if set to true, causes the resulting tree of attributes
+
# to *not* have a ".${system}" suffixed upon every job name like Hydra
+
# expects. So far, this is only implemented for `tests`.
+
#
+
# This flag exists mainly for use by ci/eval/attrpaths.nix; see
+
# that file for full details. The exact behavior of this flag
+
# may change; it should be considered an internal implementation
+
# detail of ci/eval.
+
attrNamesOnly ? false,
}:
with import ../pkgs/top-level/release-lib.nix { inherit supportedSystems; };
···
import ./tests/all-tests.nix {
inherit system;
pkgs = import ./.. { inherit system; };
-
callTest = config: {
-
${system} = hydraJob config.test;
-
};
+
callTest =
+
config:
+
if attrNamesOnly then
+
hydraJob config.test
+
else
+
{
+
${system} = hydraJob config.test;
+
};
}
// {
# for typechecking of the scripts and evaluation of
···
allDrivers = import ./tests/all-tests.nix {
inherit system;
pkgs = import ./.. { inherit system; };
-
callTest = config: {
-
${system} = hydraJob config.driver;
-
};
+
callTest =
+
config:
+
if attrNamesOnly then
+
hydraJob config.test
+
else
+
{
+
${system} = hydraJob config.driver;
+
};
};
};
-
allTests = foldAttrs recursiveUpdate { } (map allTestsForSystem supportedSystems);
+
allTests = foldAttrs recursiveUpdate { } (
+
map allTestsForSystem (if attrNamesOnly then [ (head supportedSystems) ] else supportedSystems)
+
);
pkgs = import ./.. { system = "x86_64-linux"; };