Skip to content

Commit

Permalink
doc/testers: Edit deprecation warning for nixosTest
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Sidhion <DanielSidhion@users.noreply.github.com>
  • Loading branch information
roberth and DanielSidhion committed Apr 22, 2024
1 parent 43bb838 commit 4e69ce4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions doc/build-helpers/testers.chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit 4e69ce4

Please sign in to comment.