nixos/testing: Add test attribute to please discoverTests

This commit is contained in:
Robert Hensing 2025-07-07 19:46:37 +02:00
parent 0295ad1904
commit 0e32661202
2 changed files with 7 additions and 0 deletions

View File

@ -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

View File

@ -18,6 +18,8 @@
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