Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions nixos/lib/testing/run.nix
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ in
# useful for inspection (debugging / exploration)
passthru.config = config;

/**
For discoverTests only. Deprecated. Will be removed when discoverTests can be removed from NixOS all-tests.nix.
*/
passthru.test = config.test;

# Docs: nixos/doc/manual/development/writing-nixos-tests.section.md
/**
See https://nixos.org/manual/nixos/unstable#sec-override-nixos-test
Expand Down
4 changes: 3 additions & 1 deletion nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
with pkgs.lib;

let
# TODO: remove when handleTest is gone (make sure nixosTests and nixos/release.nix#tests are unaffected)
# TODO: when removing, also deprecate `test` attribute in ../lib/testing/run.nix
discoverTests =
val:
if isAttrs val then
if hasAttr "test" val then
if (val ? test) then
callTest val
else
mapAttrs (n: s: if n == "passthru" then s else discoverTests s) val
Expand Down