From 6229f0bc8f4ae4c988e9d76937e0aaedea067de4 Mon Sep 17 00:00:00 2001 From: Atemu Date: Sun, 6 Aug 2023 15:40:10 +0200 Subject: [PATCH] all-tests: exclude passthru attributes from test discovery discoverTests tries to discover some sort of internal function and tries to call it with the arguments for that internal function. This poses an issue when you want to expose some other functions (i.e. a parameterisation for a test) in nixosTests. This commit allows a test to pass through arbitrary values via `.passthru` without them having discovery applied to them; including functions. --- nixos/tests/all-tests.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 3b4a39f5ff9..70548ebe55d 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -21,7 +21,7 @@ let if isAttrs val then if hasAttr "test" val then callTest val - else mapAttrs (n: s: discoverTests s) val + else mapAttrs (n: s: if n == "passthru" then s else discoverTests s) val else if isFunction val then # Tests based on make-test-python.nix will return the second lambda