You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using new Microsoft.Testing.Platform library with TUnit framework. It seems like not all of the test filtering operators documented in graph query filtering are supported. For example, when using TUnit with --treenode-filter command line parameter the not equal != operator doesn't seem to be working for me.
Steps To Reproduce
Consider the following code snippet:
public class MyTests
{
[Test]
[Category("Smoke")]
public void TestWithCategory()
{
// ...
}
[Test]
public void TestWithoutCategory()
{
// ...
}
}
The following command runs only the first test, as expected dotnet run --treenode-filter /*/*/*/*[Category=Smoke]:
Test run summary: Passed! - bin\Debug\net9.0\Engine.Tests.dll (net9.0|x64)
total: 1
failed: 0
succeeded: 1
skipped: 0
duration: 91ms
However, dotnet run --treenode-filter /*/*/*/*[Category!=Smoke] doesn't seem to find anything:
Test run summary: Zero tests ran - bin\Debug\net9.0\Engine.Tests.dll (net9.0|x64)
total: 0
failed: 0
succeeded: 0
skipped: 0
duration: 88ms
Expected behavior
Filter should exclude tests with Category property set to Smoke.
Describe the bug
Using new Microsoft.Testing.Platform library with
TUnit
framework. It seems like not all of the test filtering operators documented in graph query filtering are supported. For example, when usingTUnit
with--treenode-filter
command line parameter the not equal!=
operator doesn't seem to be working for me.Steps To Reproduce
Consider the following code snippet:
The following command runs only the first test, as expected
dotnet run --treenode-filter /*/*/*/*[Category=Smoke]
:However,
dotnet run --treenode-filter /*/*/*/*[Category!=Smoke]
doesn't seem to find anything:Expected behavior
Filter should exclude tests with
Category
property set toSmoke
.Actual behavior
Filter excludes all tests.
Additional context
Seems like filter parser doesn't support
!=
operator at all - https://github.com/microsoft/testfx/blob/main/src/Platform/Microsoft.Testing.Platform/Requests/TreeNodeFilter/TreeNodeFilter.cs#L56Related issue in
TUnit
repository - thomhurst/TUnit#1381SDK version: 9.0.101
OS version: Microsoft Windows [Version 10.0.26100.2454]
TUnit version: 0.4.86
Microsoft.Testing.Platform version: 1.4.3
The text was updated successfully, but these errors were encountered: