Merge pull request #196281 from hercules-ci/restore-nixos-test-dx

nixos: Restore test DX
main
Robert Hensing 2 years ago committed by GitHub
commit 14a822f72a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      nixos/lib/testing-python.nix
  2. 2
      nixos/lib/testing/nodes.nix
  3. 4
      nixos/tests/make-test-python.nix

@ -29,7 +29,9 @@ rec {
};
};
# Make a full-blown test
# Make a full-blown test (legacy)
# For an official public interface to the tests, see
# https://nixos.org/manual/nixos/unstable/index.html#sec-calling-nixos-tests
makeTest =
{ machine ? null
, nodes ? {}
@ -48,7 +50,8 @@ rec {
else builtins.unsafeGetAttrPos "testScript" t)
, extraPythonPackages ? (_ : [])
, interactive ? {}
} @ t:
} @ t: let
testConfig =
(evalTest {
imports = [
{ _file = "makeTest parameters"; config = t; }
@ -60,6 +63,9 @@ rec {
}
];
}).config;
in
testConfig.test # For nix-build
// testConfig; # For all-tests.nix
simpleTest = as: (makeTest as).test;

@ -101,7 +101,7 @@ in
nodesCompat =
mapAttrs
(name: config: config // {
config = lib.warn
config = lib.warnIf (lib.isInOldestRelease 2211)
"Module argument `nodes.${name}.config` is deprecated. Use `nodes.${name}` instead."
config;
})

@ -6,6 +6,4 @@ f: {
with import ../lib/testing-python.nix { inherit system pkgs; };
let testConfig = makeTest (if pkgs.lib.isFunction f then f (args // { inherit pkgs; inherit (pkgs) lib; }) else f);
in testConfig.test # For nix-build
// testConfig # For all-tests.nix
makeTest (if pkgs.lib.isFunction f then f (args // { inherit pkgs; inherit (pkgs) lib; }) else f)

Loading…
Cancel
Save