Skip to content
Latchkey

dotnet test "--filter" Matched No Tests in CI

A dotnet test --filter expression matched no tests. The filter syntax, trait name, or fully-qualified name is wrong, so the run executes nothing - which can silently "pass" or fail depending on settings.

What this error means

The test step reports "No test matches the given testcase filter" and runs zero tests. The build looks green while nothing was actually verified, or fails if zero-tests-is-an-error is configured.

dotnet test output
No test matches the given testcase filter `Category=Integraton` in MyApp.Tests.dll

Common causes

Wrong trait name or value

A typo in a category/trait (Integraton vs Integration) or a value the tests do not actually use means the filter matches nothing.

Incorrect filter syntax or property

Using the wrong property (Name vs FullyQualifiedName/DisplayName), or bad operators, produces an expression that no test satisfies.

How to fix it

List tests to confirm names and traits

Enumerate the available tests and their traits so the filter targets real values.

Terminal
dotnet test --list-tests
# then filter on a real trait/name
dotnet test --filter "Category=Integration"

Use the correct filter properties

Filter on supported properties with valid operators.

Terminal
# fully-qualified name contains
dotnet test --filter "FullyQualifiedName~Cache"
# combine traits
dotnet test --filter "Category=Unit&Priority=1"

How to prevent it

  • Verify filter expressions against dotnet test --list-tests before relying on them in CI.
  • Standardize trait names so filters stay valid as tests are added.
  • Fail the job when zero tests run, so an empty filter does not pass silently.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →