Merge pull request #193485 from hercules-ci/nixos-lib-runTest-return-test
nixos/testing: Fix release.nix tests evaluation
This commit is contained in:
commit
f54f12a602
5 changed files with 8 additions and 12 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -67,6 +67,6 @@
|
|||
else test;
|
||||
calledTest = lib.toFunction loadedTest pkgs;
|
||||
in
|
||||
nixosTesting.makeTest calledTest;
|
||||
nixosTesting.simpleTest calledTest;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue