Open dhrumil0902 opened 5 months ago
@OsirisTerje pls take a look if possible =)
I just ran these in the Test explorer, and add the category as a trait,and using Run All they are not executed for different reasons. The MyTest because it is Ignored, the AnotherTest because it is Explicit, but it should have run.
You see the different icons for them:
If I remove the Ignore attribute, they do run both of them, as they should.
So it seems the Ignore does mess up something here. Nice catch!
If I add a third test class, with the same category, it does execute, but the two others doesnt, for the same different reasons. So, yes, this is a bug.
Repro uploaded to https://github.com/nunit/nunit.issues/tree/main/Issue4736
@manfred-brands Want to have a look ?
@manfred-brands any updates? @OsirisTerje I can take a look at this bug if you can point me in the right direction. I also saw on your profile that you are looking for contributors. Where and how can I start contributing?
The best way to debug this is to take the repro above, add that to a solution which also includes the framework. So clone both into their respective local repos, and let the solution span both projects.
Then it is easy to get into debugging them, and see what happens with the filter.
Note, it may be a bug in the adapter too, but currently it does look like the error is in the framework. To make sure it is in the framework and not adapter, it could be wise to run the repro using NUnitLite.
About contributing: Yes, we do want more contributors. Check out the contributing guidelines and the NUnit.org website. You should also check the NUnit governance documentation which explains the roles and project structures. Also check the docs, which may be helpful.
The bug is not there when executing tests with NUnitLite or nunit-console, so looks like the problem is in the adapter.
Ok, thanks! I'll move this issue to the adapter.
To debug into the adapter follow the steps outlined here: https://hermit.no/debugging-the-nunit3testadapter-take-2/
But do build a debug version, it makes it easier for going in there.
@OsirisTerje After debugging the code in the package, I have an idea of where this bug is coming from, but I have multiple questions. Is there a better medium to ask questions and/or ask for help?
You can join https://nunit.slack.com. Here is an invite link https://join.slack.com/t/nunit/shared_invite/zt-2o4x0nfoh-llr_V6GO5ZI4TfCXqjUUAw
@OsirisTerje Hi! Any updates on this bug? It's causing us some trouble, preventing us from using the [Ignore] attribute.
@dhrumil0902 started doing something on this issue a few weeks back. Not sure where it is now, but he might answer.
Description When applying the [Explicit] attribute and [Ignore(...)] attribute to a test class that has a custom category attribute, all classes within that category are ignored when running dotnet test while filtering by that category. Therefore no tests are ran. Please let me know if I am doing something wrong.
Steps to Reproduce
dotnet test --filter TestCategory=MyCustomCategory
on the test project.Example Code
Expected Behavior Only the specific test class with the [Ignore(...)] attribute should be ignored. Other test classes in the same category should execute as expected.
Actual Behavior All test classes within the same custom category are ignored, causing all tests in that category to be skipped.
CsProj File