summary refs log tree commit diff
path: root/nixos/lib/testing-python.nix
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2022-10-16 16:18:00 +0200
committerRobert Hensing <robert@roberthensing.nl>2022-10-16 16:30:20 +0200
commit611f247810ab76bedd6ed544068232982c071f06 (patch)
tree63a34549378bff7e8d6158754ddb5382eb422ff4 /nixos/lib/testing-python.nix
parent00b3b4ee248b52fc5588ad2d5cb0d71575938e72 (diff)
downloadnixpkgs-611f247810ab76bedd6ed544068232982c071f06.tar
nixpkgs-611f247810ab76bedd6ed544068232982c071f06.tar.gz
nixpkgs-611f247810ab76bedd6ed544068232982c071f06.tar.bz2
nixpkgs-611f247810ab76bedd6ed544068232982c071f06.tar.lz
nixpkgs-611f247810ab76bedd6ed544068232982c071f06.tar.xz
nixpkgs-611f247810ab76bedd6ed544068232982c071f06.tar.zst
nixpkgs-611f247810ab76bedd6ed544068232982c071f06.zip
nixos/tests: Generalize nix-build file.nix hack to testing-python.nix
Diffstat (limited to 'nixos/lib/testing-python.nix')
-rw-r--r--nixos/lib/testing-python.nix10
1 files changed, 8 insertions, 2 deletions
diff --git a/nixos/lib/testing-python.nix b/nixos/lib/testing-python.nix
index f63b6c78f6d..d7204a2bc14 100644
--- a/nixos/lib/testing-python.nix
+++ b/nixos/lib/testing-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;