Skip to content

Filtering parametrized tests based on just test name #7515

@nohwnd

Description

@nohwnd

Describe the bug

I have tests like

aaa (params)
aaa2 (params)

I would like to list just aaa tests but not aaa2 tests. They have parameters so the Name= filter does not work, and trying to provide aaa ( fails with error that there is empty parentheses group.

Backslash is supposed to escape it, but that does not work either.

Version used

mtest 4.1.0 + mtp

Steps To Reproduce

dotnet test test\Microsoft.TestPlatform.Acceptance.IntegrationTests\Microsoft.TestPlatform.Acceptance.IntegrationTests.csproj --list-tests --filter "Name=RunMultipleMSTestAssembliesOnVstestConsoleAndTesthostCombinations \("
Discovering tests from artifacts\bin\Microsoft.TestPlatform.Acceptance.IntegrationTests\Debug\net9.0\Microsoft.TestPlatform.Acceptance.IntegrationTests.dll (net9.0|x64)
Discovering tests from artifacts\bin\Microsoft.TestPlatform.Acceptance.IntegrationTests\Debug\net48\Microsoft.TestPlatform.Acceptance.IntegrationTests.exe (net48|x64)
Exit code: 8
  Standard output: Incorrect format for TestCaseFilter Error: Empty parenthesis ( ). Specify the correct format and try again. Note that the incorrect format can lead to no test getting executed.

Exit code: 8
  Standard output: Incorrect format for TestCaseFilter Error: Empty parenthesis ( ). Specify the correct format and try again. Note that the incorrect format can lead to no test getting executed.


Discovered 0 tests in assembly - artifacts\bin\Microsoft.TestPlatform.Acceptance.IntegrationTests\Debug\net48\Microsoft.TestPlatform.Acceptance.IntegrationTests.exe (net48|x64)

Discovered 0 tests in assembly - artifacts\bin\Microsoft.TestPlatform.Acceptance.IntegrationTests\Debug\net9.0\Microsoft.TestPlatform.Acceptance.IntegrationTests.dll (net9.0|x64)

Discovered 0 tests in 2 assemblies.

Test discovery completed with non-success exit code: 8 (see: https://aka.ms/testingplatform/exitcodes)

Metadata

Metadata

Labels

Area: MSTestIssues with MSTest that are not specific to more refined area (e.g. analyzers or assertions)External: VSTestState: Blocked

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions