nixos/testing: Fix release.nix tests evaluation

Fixes the problem introduced by 12b3066aae
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.
This commit is contained in:
Robert Hensing 2022-09-29 10:32:31 +02:00
parent f4e8fc64ca
commit aed1deab05
5 changed files with 8 additions and 12 deletions

View file

@ -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;

View file

@ -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;
};
};
}

View file

@ -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

View file

@ -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

View file

@ -67,6 +67,6 @@
else test;
calledTest = lib.toFunction loadedTest pkgs;
in
nixosTesting.makeTest calledTest;
nixosTesting.simpleTest calledTest;
}