From 4e69ce4a7ac4b328e06d37da0db4f9551239a213 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 7 Mar 2024 09:48:52 +0100 Subject: [PATCH] doc/testers: Edit deprecation warning for nixosTest Co-authored-by: Daniel Sidhion --- doc/build-helpers/testers.chapter.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/build-helpers/testers.chapter.md b/doc/build-helpers/testers.chapter.md index 2e5e8ce7a26c8..c6ccc9a62bedb 100644 --- a/doc/build-helpers/testers.chapter.md +++ b/doc/build-helpers/testers.chapter.md @@ -239,12 +239,16 @@ pkgs.testers.runNixOSTest ({ lib, ... }: { ## `nixosTest` {#tester-nixosTest} -This function is deprecated in favor of [`runNixOSTest`](#tester-runNixOSTest). The reason why it's bad is that when you pass it a function, it is invoked via `callPackage`. This is somewhat incompatible with the module system and running cross-platform: - - The choice of packages is ambiguous when the VM host platform is not Linux. `nixosTest` could in theory pick either: +:::{.warning} +This function is deprecated in favor of [`runNixOSTest`](#tester-runNixOSTest). +The reason why it's bad is that when you pass it a function, it is invoked via `callPackage`. +This is somewhat incompatible with the module system and running cross-platform: + - The choice of packages is ambiguous when the VM host platform is not Linux. + `nixosTest` could in theory pick either: - `hostPkgs` for packages to run on the VM host - or `config.node.pkgs` for packages that run in one of the VMs - The return value of the passed function should have been a module, but `nixosTest` does not actually allow that. - +::: Run a NixOS VM network test using this evaluation of Nixpkgs. NOTE: This function is primarily for external use. NixOS itself uses `make-test-python.nix` directly. Packages defined in Nixpkgs [reuse NixOS tests via `nixosTests`, plural](#ssec-nixos-tests-linking).