Skip to content

Skip methods in test-merging if they use the named argument 'Skip' for the Fact attributes #85495

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

Merged
merged 2 commits into from
Apr 28, 2023

Conversation

TIHan
Copy link
Contributor

@TIHan TIHan commented Apr 27, 2023

No description provided.

@ghost ghost assigned TIHan Apr 27, 2023
@ghost
Copy link

ghost commented Apr 27, 2023

Tagging subscribers to this area: @hoyosjs
See info in area-owners.md if you want to be subscribed.

Issue Details

null

Author: TIHan
Assignees: TIHan
Labels:

area-Infrastructure-coreclr

Milestone: -

@TIHan TIHan force-pushed the test-merge-fact-skip branch from ce729a4 to 802d0bf Compare April 27, 2023 23:33
@TIHan TIHan changed the title Skip methods in test-merging if they use the named argument 'Skip' Skip methods in test-merging if they use the named argument 'Skip' for the Fact attributes Apr 27, 2023
@TIHan
Copy link
Contributor Author

TIHan commented Apr 27, 2023

/azp run runtime-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@TIHan
Copy link
Contributor Author

TIHan commented Apr 27, 2023

/azp run runtime-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@TIHan
Copy link
Contributor Author

TIHan commented Apr 28, 2023

@dotnet/jit-contrib this is ready

@markples
Copy link
Contributor

@jkoritzinsky I was wondering about the intentions for the attribute system. Is the goal (subject to prioritizing the work of course) full compatibility with xunit, or doing that within some context of dotnet/runtime-specific goals? For example, was this intentionally left off because something like ActiveIssueAttribute should be used instead? Do we want to be propagating "skips" up to DevOps for reporting? And so on. Thanks!

switch (attr.AttributeClass?.ToDisplayString())
{
case "Xunit.ConditionalFactAttribute":
filterAttributes.Add(attr);
factAttribute = true;
if (!hasSkip)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a prime example for the newer C# switch syntax

case "Xunit.ConditionalFactAttribute" when !hasSkip:

though perhaps the right solution is to put all of these into filterAttributes so that filtering can then drop them like other filters do (and skip reporting, etc., would have a single place to be implemented).

@jkoritzinsky
Copy link
Member

I was wondering about the intentions for the attribute system. Is the goal (subject to prioritizing the work of course) full compatibility with xunit, or doing that within some context of dotnet/runtime-specific goals? For example, was this intentionally left off because something like ActiveIssueAttribute should be used instead?

The goal is to support whatever subset of xunit + Microsoft.DotNet.XUnitExtensions that we use in the src/tests tree or used similar features of in the legacy test system. There have been talks about building more of a true xunit replacement that's all source-generated, but this system is not meant to do that (though it might be a base for it in the future).

As we start to use more features of XUnit in these tests, I'm fully onboard with adding capabilities to the generator. I didn't include it initially as we rarely use [Fact(Skip = "Message")], so I didn't realize we were expecting to use it. I'd prefer that we use [ActiveIssue] when it's a good fit, but I don't see a reason to say "don't use the Skip property ever".

Do we want to be propagating "skips" up to DevOps for reporting? And so on. Thanks!

I don't think we emit code to record unconditional skips today, but that's a good idea. We should probably do that for reporting purposes.

@BruceForstall
Copy link
Contributor

We really need to expand the documentation on how to disable tests -- https://github.com/dotnet/runtime/blob/main/docs/workflow/ci/disabling-tests.md -- to include examples of all the ways you can/should disable coreclr tests. There is a link there to the doc on disabling libraries tests.

@TIHan
Copy link
Contributor Author

TIHan commented Apr 28, 2023

@BruceForstall there is more documentation regarding new ways to disable tests: https://github.com/dotnet/runtime/blob/main/docs/workflow/testing/libraries/filtering-tests.md

I think it's fair to handle the Skip named argument, but I think @markples is right that it might be better to use ActiveIssue instead of the Skip named argument for the particular test in which I used Skip. I will update that particular test and also update the documentation to talk about the Skip named argument.

@TIHan TIHan merged commit 4719575 into dotnet:main Apr 28, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants