-
Notifications
You must be signed in to change notification settings - Fork 106
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
Applying [Explicit] and [Ignore] Attributes to Test Class with Custom Category Ignores All Tests in Category #1197
Comments
@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. 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. |
@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 |
@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
The text was updated successfully, but these errors were encountered: