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

Generic Filter expressions for NUnit tree #1150

Open
CharliePoole opened this issue Oct 19, 2024 · 1 comment
Open

Generic Filter expressions for NUnit tree #1150

CharliePoole opened this issue Oct 19, 2024 · 1 comment
Labels
Design A pure design task, done prior to coding. Rarely needed.
Milestone

Comments

@CharliePoole
Copy link
Contributor

So far we have discussed specific filters. But NUnit itself supports a general filter using the --where option of the console runner. The framework knows how to deal with the filters created by this option - (I wrote the parser)

Do we want this sort of functionality for the GUI? A command-line option does not seem very useful. Howe would we expose it the feature?

Decisions:

  • Decide if we want this
  • Decide how the user would activate it in the GUI
  • Decide how it would display in the tree
  • Decide what happens to the run commands if a filter is active.
@CharliePoole CharliePoole added the Design A pure design task, done prior to coding. Rarely needed. label Oct 19, 2024
@CharliePoole CharliePoole added this to the 2.0.0-beta7 milestone Oct 19, 2024
@rowo360
Copy link
Contributor

rowo360 commented Feb 12, 2025

Here is an idea of how we could support the general NUnit filter:
First of all, I think that the existing filter functionality already supports a wide range of use cases. So I hope and expect that the majority of users won't miss anything.
But nonetheless the NUnit filter supports more use cases and some power users will notice the gap. So we should try to support them also. But my idea is that we don't create a new UI to configure this filter - that might be too tough to add UI elements to configure all those operators and expressions. Instead we can use the existing text filtering textbox for this purpose.
My consideration is, if almost only power users use this, then they also know the syntax of the NUnit filter.

Here's a screenshot how this might look like:

For example we might add a dropdown box at the end of the filter textbox. It can be used to select the filter mode: Text or NUnit. And of course we can guide the user with some Tooltips. But I hope that it's self-explanatory.

I imagine that the filtering itself can be performed by a Runner.Explore(testfilter) call. This call will return a XmlNode/TestNode which can be used to get a list of IDs which are matching the filter.
This idea would fit very well to the existing filtering (regarding display in tree and also to the run command when filter is active).

One drawback of this idea: the user can edit incorrect syntax of the filter statement. We must deal with this incorrect syntax somehow, provide some feedback and decide how to filter the tree in this case...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design A pure design task, done prior to coding. Rarely needed.
Projects
None yet
Development

No branches or pull requests

2 participants