diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 528b8aa42..f9c0ed139 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -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 -- `. - [ ] Test cases updated/added. See [example](https://github.com/nix-community/home-manager/commit/f3fbb50b68df20da47f9b0def5607857fcc0d021#diff-b61a6d542f9036550ba9c401c80f00ef). diff --git a/Justfile b/Justfile index 183f50a0c..7933e3970 100644 --- a/Justfile +++ b/Justfile @@ -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: diff --git a/docs/manual/contributing/tests.md b/docs/manual/contributing/tests.md index 74284350a..a42c8f1dc 100644 --- a/docs/manual/contributing/tests.md +++ b/docs/manual/contributing/tests.md @@ -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.