diff options
author | K900 <me@0upti.me> | 2022-09-29 12:54:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-29 12:54:30 +0300 |
commit | f54f12a6021419fccf66e06bfe35f2d684cfd8c7 (patch) | |
tree | 791032f68687eb0728005b9de5eed7a4d4abd02b /nixos | |
parent | 0f81cd747d92979012058257f8b0b6fa64cc4a94 (diff) | |
parent | aed1deab0574f663be2d401861bef303a9d023ba (diff) |
Merge pull request #193485 from hercules-ci/nixos-lib-runTest-return-test
nixos/testing: Fix release.nix tests evaluation
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 |