Option --list-tests should take into account --filter option
See original GitHub issueI’m trying to execute one particular test so I specify a filter, but dotnet test
executes several tests. So I need to understand what tests my filter captures. I would expect that --list-tests
with --filter
tells me. But it doesn’t. --list-tests
always shows all tests ignoring --filter
option which is a pity.
Steps to reproduce
dotnet test Tests.csproj --list-tests --filter FullyQualifiedName~MyClass.MyMethod
lists only tests satisfying the filter
Expected behavior
lists only tests satisfying the filter
Actual behavior
lists all tests in assembly
Issue Analytics
- State:
- Created 6 years ago
- Reactions:31
- Comments:16 (2 by maintainers)
Top Results From Across the Web
dotnet test command - .NET CLI
Filters tests in the current project using the given expression. Only tests that match the filter expression are run. For more information, see ......
Read more >dotnet vstest command - .NET CLI
The dotnet vstest command builds a project and all of its dependencies.
Read more >Jest CLI Options
Jest CLI Options. The jest command line runner has a number of useful options. You can run jest --help to view all available...
Read more >Filter an array taking into account that the filtered options ...
I have a code that should filter the array depending on some condition. One time it could be 1 condition or 2, depending...
Read more >Tempest Run
Tempest Run¶. Runs tempest tests. This command is used for running the tempest tests. Test Selection¶. Tempest run has several options:.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @evil-shrike thank you for the issue. You are correct,
--list-tests
only lists all the tests. We will discuss this enhancement.Hi @Faizan2304 is there any existing vstest API can do that?
Workaround for this case using
nunit3-console
filters format for
dotnet test
andnunit3-console
are different In my case to convert my filer fromTestCategory=Smoke|TestCategory=ProdHealthCheck
tocat==Smoke||cat==ProdHealthCheck
I had to make a few replacesAnd as a result, the
--where
+--explore
attributes output only the test list that matches the specified filter as expected.