-
Notifications
You must be signed in to change notification settings - Fork 31
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
Tree format 'Test list' and grouping 'By Category' => no categories are displayed #1106
Comments
By Category (extended) was added at somebody's request. I never liked it that much. Let's think about what we really want here. Maybe if you do a test list, you should be able to group by the categories on tests and if you do a fixture list you should be able to group by the categories on fixtures. There's a similar discussion that regularly takes place around properties. People get confused because they imagine that putting a property on a fixture is the same as putting it on each test in the fixture, but that has never been true in NUnit. Let's think about where this should go before doing anything big on it. |
Here's an attempt to describe my expectation: So far I have never bothered to check whether the category attribute was defined on the test case or on the test fixture. This has never made a difference to me so far. And when I look at this use case, I think it is essential that the tests belonging to a test category are always selected reliably and without any doubts. If users start to wonder why a test was not executed, they may also quickly lose confidence. So overall, when I select a category node in the tree, I expect all tests of that category to be executed. And I think we should aim for the same behavior when I execute a dedicated category using the '-where' parameter in the NUnit.ConsoleRunner. So in other words:
So the default 'By category' grouping will assemble category attributes from all locations. At least this would be my expectation - but it's difficult for me to anticipate the expectations of all the other users. Of course, we can and maybe should also support another type of category grouping. Perhaps I need a little more time to think about the use cases for this. So the next proposal is more based on the current behavior than considering all possible use cases.
Depending on the active tree display format either one or the other special category grouping menu item is available. |
I too will need some time to think about this. This is similar to an issue that comes up with NUnit all the time: should properties be inherited? That is, when a property is added to the test fixture, is it also "present" on the individual cases in some sense? Does it affect them? For properties in general, the answer is "it depends". An But if we had an Categories are basically degenerate properties. They have a name but no value. Their purpose is exactly what you say: to execute subsets of tests. So I think we should be able to come up with a standard way to display them without having two different menu items. Your proposal might do it. But as I said at the start, I'd like to think about it for a while. Going back to bed now. :-) |
This issue is almost completly solved by PR #1118. Reading carefully through the previous comments I noticed that the case 'Fixture list' + 'By category' and test category is defined on test case is not working as expected yet. I need to continue to look at this case. |
What isn't working yet? |
I decided to create a separate issue for the last observation #1134. Allthough it might be technical related, it's a different use case. |
Describe the bug
This bug is a continuation of the work to support the different tree view display formats (#1101).
Maybe this issue is no bug at all, but instead the expected system behavior. But I was irritated for a long time and thought something wasn't working properly. Now that I have analyzed, debugged and understood it, I can explain the behavior. But maybe other users feel the same way and we can support them better.
To Reproduce
Steps to reproduce the behavior:
=> Categories in test project are not found!
However if I switch to grouping 'By Category (extended)' the categories are suddenly displayed:

Expected behavior
I expected that the categories are already shown when selecting 'By category' grouping.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: