summaryrefslogtreecommitdiffstats
path: root/nixos/lib
diff options
context:
space:
mode:
authorRobert Hensing <roberth@users.noreply.github.com>2022-10-18 11:38:37 +0200
committerGitHub <noreply@github.com>2022-10-18 11:38:37 +0200
commit14a822f72ac99fe9421aa3b6ffc630beaf45a887 (patch)
tree6acb34a2dfb7ac4b1d7d24d31edae6f146c76aa6 /nixos/lib
parent3f6e84398669ce7abd78e73dc088fc420dc44218 (diff)
parent1d9b9130883550f2f928c573b35fe8b8193d5c4b (diff)
Merge pull request #196281 from hercules-ci/restore-nixos-test-dx
nixos: Restore test DX
Diffstat (limited to 'nixos/lib')
-rw-r--r--nixos/lib/testing-python.nix10
-rw-r--r--nixos/lib/testing/nodes.nix2
2 files changed, 9 insertions, 3 deletions
diff --git a/nixos/lib/testing-python.nix b/nixos/lib/testing-python.nix
index f63b6c78f6da..d7204a2bc143 100644
--- a/nixos/lib/testing-python.nix
+++ b/nixos/lib/testing-python.nix
@@ -29,7 +29,9 @@ rec {
};
};
- # Make a full-blown test
+ # Make a full-blown test (legacy)
+ # For an official public interface to the tests, see
+ # https://nixos.org/manual/nixos/unstable/index.html#sec-calling-nixos-tests
makeTest =
{ machine ? null
, nodes ? {}
@@ -48,7 +50,8 @@ rec {
else builtins.unsafeGetAttrPos "testScript" t)
, extraPythonPackages ? (_ : [])
, interactive ? {}
- } @ t:
+ } @ t: let
+ testConfig =
(evalTest {
imports = [
{ _file = "makeTest parameters"; config = t; }
@@ -60,6 +63,9 @@ rec {
}
];
}).config;
+ in
+ testConfig.test # For nix-build
+ // testConfig; # For all-tests.nix
simpleTest = as: (makeTest as).test;
diff --git a/nixos/lib/testing/nodes.nix b/nixos/lib/testing/nodes.nix
index 0395238cbaae..8e620c96b3bb 100644
--- a/nixos/lib/testing/nodes.nix
+++ b/nixos/lib/testing/nodes.nix
@@ -101,7 +101,7 @@ in
nodesCompat =
mapAttrs
(name: config: config // {
- config = lib.warn
+ config = lib.warnIf (lib.isInOldestRelease 2211)
"Module argument `nodes.${name}.config` is deprecated. Use `nodes.${name}` instead."
config;
})