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

Should ConditionalClass and similar attributes in XUnitExtensions filter tests out automatically? #15195

Open
ViktorHofer opened this issue Oct 22, 2024 · 4 comments

Comments

@ViktorHofer
Copy link
Member

ViktorHofer commented Oct 22, 2024

ConditionalClass and similar attributes add a failing trait to the tests that should conditionally not run:

yield return new KeyValuePair<string, string>(XunitConstants.Category, XunitConstants.Failing);

It might make sense to automatically filter those out without relying on the test settings to exclude the failing trait (i.e. in a .runsettings file).

@Wraith2
Copy link

Wraith2 commented Mar 3, 2025

This is a problem which affects running tests in SqlClient and has done for many years. If there is a chance it can be fixed that would be very useful and allow tests to be run from inside visual studio which has never been useful before.

@dotnet/sqlclientdevteam may want to weigh in and identify if they consider this something important to them.

@David-Engel
Copy link

I don't know about the "failing" terminology on this issue. But we (SqlClient) do see tests run in the VS GUI that are filtered out (Skipped) in command-line tests runs by ConditionalFacts that exclude them based on environment or other logic. It would be really nice if the VS GUI behaved the same.

@akoeplinger
Copy link
Member

@David-Engel can you please try again once you get an arcade update with Microsoft.DotNet.XUnitExtensions version 10.0.0-beta.25175.1 or later? I think I fixed the issue with ConditionalFacts not working in VS with #15667

@akoeplinger
Copy link
Member

And just to make this issue more accurate: ConditionalFact/ConditionalTheory do not use the "failing" category, only ConditionalClass does.

@akoeplinger akoeplinger changed the title Should ConditionalFact and similar attributes in XUnitExtensions filter tests out automatically? Should ConditionalClass and similar attributes in XUnitExtensions filter tests out automatically? Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants