Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not equal operator is not working with --treenode-filter command line parameter #1381

Closed
sergey-rybalkin opened this issue Dec 9, 2024 · 5 comments

Comments

@sergey-rybalkin
Copy link

Not sure whether this is a TUnit or TestFx issue, but it seems like not all of the test filtering operators documented in Microsoft Testing Platform are supported with --treenode-filter command line parameter. In particular, not equal != doesn't seem to be working for me. 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

SDK 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

@thomhurst
Copy link
Owner

Yeah this will be a Microsoft one - Let me see if I can transfer it to their repo

@thomhurst
Copy link
Owner

Ah I can't - I need write access to their repo to do that. Could you raise this on the testfx repo?

@sergey-rybalkin
Copy link
Author

Ah I can't - I need write access to their repo to do that. Could you raise this on the testfx repo?

Sure, thanks

Copy link
Contributor

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Jan 11, 2025
@sergey-rybalkin
Copy link
Author

sergey-rybalkin commented Jan 12, 2025

Seems like it can be closed now as it was fixed in Microsoft.Testing.Platform v1.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants