docs: correct test command guidance

Document list and run commands separately, keep test runner usage through the flake wrapper, and avoid stale legacy full-suite commands.
This commit is contained in:
Austin Horstman 2026-06-19 16:27:42 -05:00
parent e45cc6e15a
commit e731ff60ec
3 changed files with 18 additions and 8 deletions

View file

@ -24,8 +24,8 @@ Also make sure to read the guidelines found at
- [ ] Code formatted with `nix fmt` or
`nix-shell -A dev --run treefmt`.
- [ ] Code tested through `nix run .#tests -- test-all` or
`nix-shell --pure tests -A run.all`.
- [ ] Code tested through `nix build .#test-all`
or a targeted `nix run .#tests -- <pattern>`.
- [ ] Test cases updated/added. See [example](https://github.com/nix-community/home-manager/commit/f3fbb50b68df20da47f9b0def5607857fcc0d021#diff-b61a6d542f9036550ba9c401c80f00ef).

View file

@ -11,9 +11,13 @@ list *pattern:
test *pattern:
nix run .#tests -- {{pattern}}
# List integration tests
list_integration_tests:
nix run .#tests -- -t -l
# Run integration tests
integration_tests:
nix run .#tests -- -t -l
nix run .#tests -- -t integration-test-
# Create a news entry
create-news-entry:

View file

@ -192,16 +192,22 @@ $ nix run .#tests -- alacritty
# Run a specific test
$ nix run .#tests -- test-alacritty-empty-settings
# Run integration tests
# List integration tests
$ nix run .#tests -- -t -l
# Run all integration tests
$ nix run .#tests -- -t integration-test-
# Interactive test selection (requires fzf)
$ python3 tests/tests.py -i
$ nix run .#tests -- -i
# Pass additional nix build flags
$ nix run .#tests -- alacritty -- --verbose
```
Integration tests are only exposed on Linux. On other platforms, integration
test discovery may report no matching tests.
## Manual test commands {#sec-tests-manual}
For advanced usage or CI environments, you can also run tests manually using nix build commands.
@ -215,7 +221,7 @@ $ nix-build --pure --option allow-import-from-derivation false tests -A build.al
in the project root. List all test cases through
``` shell
$ nix-build --pure tests --option allow-import-from-derivation false -A list
$ nix run .#tests -- -l
```
and run an individual test, for example `alacritty-empty-settings`,
@ -230,13 +236,13 @@ and may cause failures. To run against the Nixpkgs from the `flake.lock` file,
use instead e.g.
``` shell
$ nix build --option allow-import-from-derivation false .#test-all
$ nix build .#test-all
```
or
``` shell
$ nix build --option allow-import-from-derivation false .#test-alacritty-empty-settings
$ nix build .#test-alacritty-empty-settings
```
Some tests may be marked with `enableLegacyIfd`, those may be run by run with e.g.