diff options
author | Robert Hensing <robert@roberthensing.nl> | 2022-09-29 10:32:31 +0200 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2022-09-29 10:49:09 +0200 |
commit | aed1deab0574f663be2d401861bef303a9d023ba (patch) | |
tree | f75ec9a741d7f2c72c1d6891ac8042416256ab65 /nixos | |
parent | f4e8fc64ca9fa42dcfa249dd5e251b41dcf873c8 (diff) |
nixos/testing: Fix release.nix tests evaluation
Fixes the problem introduced by 12b3066aae46a8ccc3d21f54f668a3f4be344332 which caused nixos/release.nix to return the wrong attributes, while intending to only affect nixos/lib's runTest. This also removes callTest from the test options, because callTest is only ever invoked by all-tests.nix.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/lib/testing-python.nix | 4 | ||||
-rw-r--r-- | nixos/lib/testing/call-test.nix | 6 | ||||
-rw-r--r-- | nixos/lib/testing/default.nix | 2 | ||||
-rw-r--r-- | nixos/tests/all-tests.nix | 6 |
4 files changed, 7 insertions, 11 deletions
diff --git a/nixos/lib/testing-python.nix b/nixos/lib/testing-python.nix index c303b0bf17bc0..f63b6c78f6da3 100644 --- a/nixos/lib/testing-python.nix +++ b/nixos/lib/testing-python.nix @@ -49,7 +49,7 @@ rec { , extraPythonPackages ? (_ : []) , interactive ? {} } @ t: - runTest { + (evalTest { imports = [ { _file = "makeTest parameters"; config = t; } { @@ -59,7 +59,7 @@ rec { }; } ]; - }; + }).config; simpleTest = as: (makeTest as).test; diff --git a/nixos/lib/testing/call-test.nix b/nixos/lib/testing/call-test.nix index e3716bf163aa3..9abcea07455ef 100644 --- a/nixos/lib/testing/call-test.nix +++ b/nixos/lib/testing/call-test.nix @@ -4,13 +4,9 @@ let in { options = { - callTest = mkOption { - internal = true; - type = types.functionTo types.raw; - }; result = mkOption { internal = true; - default = config.test; + default = config; }; }; } diff --git a/nixos/lib/testing/default.nix b/nixos/lib/testing/default.nix index 676d52f5c3fb7..9d4f9dbc43d76 100644 --- a/nixos/lib/testing/default.nix +++ b/nixos/lib/testing/default.nix @@ -2,7 +2,7 @@ let evalTest = module: lib.evalModules { modules = testModules ++ [ module ]; }; - runTest = module: (evalTest module).config.result; + runTest = module: (evalTest ({ config, ... }: { imports = [ module ]; result = config.test; })).config.result; testModules = [ ./call-test.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index d5eb4a399d605..011d7b11b4f86 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -45,9 +45,9 @@ let inherit (rec { - doRunTest = arg: (import ../lib/testing-python.nix { inherit system pkgs; }).runTest { - imports = [ arg { inherit callTest; } ]; - }; + doRunTest = arg: ((import ../lib/testing-python.nix { inherit system pkgs; }).evalTest { + imports = [ arg ]; + }).config.result; findTests = tree: if tree?recurseForDerivations && tree.recurseForDerivations then |