File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed
Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -482,15 +482,20 @@ public class InMemoryDatabaseTests
482482
483483``` bash
484484# Run fast unit tests first
485- dotnet test --filter " Category=Unit" --no-build
485+ dotnet test --no-build -- --treenode- filter " /*/*/*/*[ Category=Unit] "
486486
487487# Run slower integration tests separately
488- dotnet test --filter " Category=Integration" --no-build
488+ dotnet test --no-build -- --treenode- filter " /*/*/*/*[ Category=Integration] "
489489
490490# Run expensive E2E tests last
491- dotnet test --filter " Category=E2E" --no-build
491+ dotnet test --no-build -- --treenode- filter " /*/*/*/*[ Category=E2E] "
492492```
493493
494+ > ** Note** : With .NET 10 SDK or newer, you can use the simpler syntax:
495+ > ``` bash
496+ > dotnet test --no-build --treenode-filter " /**[Category=Unit]"
497+ > ` ` `
498+
494499# ## Use Test Result Caching
495500
496501` ` ` xml
Original file line number Diff line number Diff line change @@ -331,7 +331,7 @@ test:integration:
331331 - build
332332 script :
333333 - dotnet test --configuration $BUILD_CONFIGURATION --no-build
334- --filter "Category=Integration"
334+ -- --treenode- filter "/*/*/*/*[ Category=Integration] "
335335 --report-trx --results-directory ./TestResults
336336 artifacts :
337337 when : always
@@ -590,13 +590,18 @@ Run different test categories in separate jobs:
590590``` yaml
591591# Unit tests (fast)
592592- name : Unit Tests
593- run : dotnet test --filter "Category=Unit"
593+ run : dotnet test -- --treenode- filter "/*/*/*/*[ Category=Unit] "
594594
595595# Integration tests (slower)
596596- name : Integration Tests
597- run : dotnet test --filter "Category=Integration"
597+ run : dotnet test -- --treenode- filter "/*/*/*/*[ Category=Integration] "
598598` ` `
599599
600+ > **Note**: With .NET 10 SDK or newer, you can use the simpler syntax without the ` --` separator:
601+ > ```yaml
602+ > run: dotnet test --treenode-filter "/**[Category=Unit]"
603+ > ```
604+
600605# ## Fail Fast in PRs
601606
602607Use fail-fast mode for quick feedback in pull requests :
You can’t perform that action at this time.
0 commit comments