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:
@@ -24,8 +24,8 @@ Also make sure to read the guidelines found at
|
|||||||
- [ ] Code formatted with `nix fmt` or
|
- [ ] Code formatted with `nix fmt` or
|
||||||
`nix-shell -A dev --run treefmt`.
|
`nix-shell -A dev --run treefmt`.
|
||||||
|
|
||||||
- [ ] Code tested through `nix run .#tests -- test-all` or
|
- [ ] Code tested through `nix build .#test-all`
|
||||||
`nix-shell --pure tests -A run.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).
|
- [ ] Test cases updated/added. See [example](https://github.com/nix-community/home-manager/commit/f3fbb50b68df20da47f9b0def5607857fcc0d021#diff-b61a6d542f9036550ba9c401c80f00ef).
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,13 @@ list *pattern:
|
|||||||
test *pattern:
|
test *pattern:
|
||||||
nix run .#tests -- {{pattern}}
|
nix run .#tests -- {{pattern}}
|
||||||
|
|
||||||
|
# List integration tests
|
||||||
|
list_integration_tests:
|
||||||
|
nix run .#tests -- -t -l
|
||||||
|
|
||||||
# Run integration tests
|
# Run integration tests
|
||||||
integration_tests:
|
integration_tests:
|
||||||
nix run .#tests -- -t -l
|
nix run .#tests -- -t integration-test-
|
||||||
|
|
||||||
# Create a news entry
|
# Create a news entry
|
||||||
create-news-entry:
|
create-news-entry:
|
||||||
|
|||||||
@@ -192,16 +192,22 @@ $ nix run .#tests -- alacritty
|
|||||||
# Run a specific test
|
# Run a specific test
|
||||||
$ nix run .#tests -- test-alacritty-empty-settings
|
$ nix run .#tests -- test-alacritty-empty-settings
|
||||||
|
|
||||||
# Run integration tests
|
# List integration tests
|
||||||
$ nix run .#tests -- -t -l
|
$ nix run .#tests -- -t -l
|
||||||
|
|
||||||
|
# Run all integration tests
|
||||||
|
$ nix run .#tests -- -t integration-test-
|
||||||
|
|
||||||
# Interactive test selection (requires fzf)
|
# Interactive test selection (requires fzf)
|
||||||
$ python3 tests/tests.py -i
|
$ nix run .#tests -- -i
|
||||||
|
|
||||||
# Pass additional nix build flags
|
# Pass additional nix build flags
|
||||||
$ nix run .#tests -- alacritty -- --verbose
|
$ 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}
|
## Manual test commands {#sec-tests-manual}
|
||||||
|
|
||||||
For advanced usage or CI environments, you can also run tests manually using nix build commands.
|
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
|
in the project root. List all test cases through
|
||||||
|
|
||||||
``` shell
|
``` 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`,
|
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.
|
use instead e.g.
|
||||||
|
|
||||||
``` shell
|
``` shell
|
||||||
$ nix build --option allow-import-from-derivation false .#test-all
|
$ nix build .#test-all
|
||||||
```
|
```
|
||||||
|
|
||||||
or
|
or
|
||||||
|
|
||||||
``` shell
|
``` 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.
|
Some tests may be marked with `enableLegacyIfd`, those may be run by run with e.g.
|
||||||
|
|||||||
Reference in New Issue
Block a user