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

Treenode Filtering not working with All Nodes Wildcard /** #3936

Open
thomhurst opened this issue Oct 11, 2024 · 0 comments
Open

Treenode Filtering not working with All Nodes Wildcard /** #3936

thomhurst opened this issue Oct 11, 2024 · 0 comments
Labels
Area: Testing Platform Belongs to the Microsoft.Testing.Platform core library Type: Bug

Comments

@thomhurst
Copy link
Contributor

I'm not sure if I'm doing something wrong, but according to this, it should work: https://github.com/microsoft/testfx/blob/main/docs/mstest-runner-graphqueryfiltering/graph-query-filtering.md

Here's my CLI input and output:

With all nodes wildcard:

PS C:\git\TUnit\TUnit.TestProject> dotnet run --treenode-filter /**[MyKey=MyDynamicallyAddedValue] --no-restore -f net8.0

████████╗██╗   ██╗███╗   ██╗██╗████████╗
╚══██╔══╝██║   ██║████╗  ██║██║╚══██╔══╝
   ██║   ██║   ██║██╔██╗ ██║██║   ██║
   ██║   ██║   ██║██║╚██╗██║██║   ██║
   ██║   ╚██████╔╝██║ ╚████║██║   ██║
   ╚═╝    ╚═════╝ ╚═╝  ╚═══╝╚═╝   ╚═╝

   TUnit v1.0.0.0 | 64-bit | Microsoft Windows 10.0.22631 | win-x64 | .NET 8.0.8 | Microsoft Testing Platform v1.4.1


Test run summary: Zero tests ran - bin\Debug\net8.0\TUnit.TestProject.dll (net8.0|x64)
  total: 0
  failed: 0
  succeeded: 0
  skipped: 0
  duration: 223ms

PS C:\git\TUnit\TUnit.TestProject>

Specifying class name:

PS C:\git\TUnit\TUnit.TestProject> dotnet run --treenode-filter /*/*/FilterByDynamicAddedPropertyTests/*[MyKey=MyDynamicallyAddedValue] --no-restore -f net8.0

████████╗██╗   ██╗███╗   ██╗██╗████████╗
╚══██╔══╝██║   ██║████╗  ██║██║╚══██╔══╝
   ██║   ██║   ██║██╔██╗ ██║██║   ██║
   ██║   ██║   ██║██║╚██╗██║██║   ██║
   ██║   ╚██████╔╝██║ ╚████║██║   ██║
   ╚═╝    ╚═════╝ ╚═╝  ╚═══╝╚═╝   ╚═╝

   TUnit v1.0.0.0 | 64-bit | Microsoft Windows 10.0.22631 | win-x64 | .NET 8.0.8 | Microsoft Testing Platform v1.4.1


Test run summary: Passed! - bin\Debug\net8.0\TUnit.TestProject.dll (net8.0|x64)
  total: 31
  failed: 0
  succeeded: 31
  skipped: 0
  duration: 285ms

PS C:\git\TUnit\TUnit.TestProject>

As you can see, the filter doesn't match when using the double asterix wildcard?

Filter match returns false:

Image

The path I build/pass to the filter service is:
/TUnit.TestProject/TUnit.TestProject/FilterByDynamicAddedPropertyTests/Test1

And the property bag contains:
KeyValuePairStringProperty { Key = MyKey, Value = MyDynamicallyAddedValue }

@Evangelink Evangelink added Type: Bug Area: Testing Platform Belongs to the Microsoft.Testing.Platform core library and removed Needs: Triage 🔍 labels Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Testing Platform Belongs to the Microsoft.Testing.Platform core library Type: Bug
Projects
None yet
Development

No branches or pull requests

2 participants