summaryrefslogtreecommitdiffstats
path: root/nixos
diff options
context:
space:
mode:
authorK900 <me@0upti.me>2022-09-29 12:54:30 +0300
committerGitHub <noreply@github.com>2022-09-29 12:54:30 +0300
commitf54f12a6021419fccf66e06bfe35f2d684cfd8c7 (patch)
tree791032f68687eb0728005b9de5eed7a4d4abd02b /nixos
parent0f81cd747d92979012058257f8b0b6fa64cc4a94 (diff)
parentaed1deab0574f663be2d401861bef303a9d023ba (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.nix4
-rw-r--r--nixos/lib/testing/call-test.nix6
-rw-r--r--nixos/lib/testing/default.nix2
-rw-r--r--nixos/tests/all-tests.nix6
4 files changed, 7 insertions, 11 deletions
diff --git a/nixos/lib/testing-python.nix b/nixos/lib/testing-python.nix
index c303b0bf17bc..f63b6c78f6da 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 e3716bf163aa..9abcea07455e 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 676d52f5c3fb..9d4f9dbc43d7 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 d5eb4a399d60..011d7b11b4f8 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