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

Update xunit #76196

Merged
merged 4 commits into from
Dec 2, 2024
Merged

Update xunit #76196

merged 4 commits into from
Dec 2, 2024

Conversation

Youssef1313
Copy link
Member

No description provided.

@Youssef1313 Youssef1313 requested a review from a team as a code owner December 1, 2024 15:35
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Issues and PRs which have not yet been triaged by a lead labels Dec 1, 2024
@dotnet-policy-service dotnet-policy-service bot added the Community The pull request was submitted by a contributor who is not a Microsoft employee. label Dec 1, 2024
@Youssef1313
Copy link
Member Author

@jaredpar The updated versions are not present in the internal feeds. Would you consider adding them and update?

My goal here is to catch up early with updates just in case there are new analyzer warnings that need to be addressed and keeping up with newer xunit versions to avoid having a future "large" jump in versions. Smaller jumps are usually a lot easier.

Note that when xunit v3 is stable, it may be really good to update to it, and even switching to Microsoft.Testing.Platform instead of VSTest.

@jaredpar
Copy link
Member

jaredpar commented Dec 2, 2024

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jaredpar
Copy link
Member

jaredpar commented Dec 2, 2024

@Youssef1313 looks like real build ambiguities

@Youssef1313 Youssef1313 requested a review from a team as a code owner December 2, 2024 19:23
@@ -65,7 +65,7 @@
await Console.Out.WriteLineAsync($"Discovering tests in {testDescriptor}...").ConfigureAwait(false);

using var xunit = new XunitFrontController(AppDomainSupport.IfAvailable, assemblyFileName, shadowCopy: false);
var configuration = ConfigReader.Load(assemblyFileName);
var configuration = ConfigReader.Load(assemblyFileName, configFileName: null);
Copy link
Member Author

Choose a reason for hiding this comment

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

For reference: A new overload was added that also has optional parameter, causing ambiguity.

@@ -28,7 +29,7 @@ public static TheoryData<LanguageVersion> LangVersions()
}

private sealed class CombinatorialLangVersions()
: CombinatorialValuesAttribute(LangVersions().Select(d => d.Single()).ToArray());
: CombinatorialValuesAttribute(((IEnumerable<object[]>)LangVersions()).Select(d => d.Single()).ToArray());
Copy link
Member Author

Choose a reason for hiding this comment

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

For reference: Previously TheoryData<T> was an IEnumerable<object[]>, but now it's both IEnumerable<object[]> and IEnumerable<T>, causing Linq's Select to not be resolved properly without the cast.

@Youssef1313
Copy link
Member Author

Thanks @jaredpar. Let's see now maybe.

@Youssef1313
Copy link
Member Author

@jaredpar Are you interested in fixing https://xunit.net/xunit.analyzers/rules/xUnit2031, or do you think it should be suppressed instead? There is not much violations.

@Youssef1313 Youssef1313 requested a review from a team as a code owner December 2, 2024 19:59
@Youssef1313
Copy link
Member Author

I pushed a fix for now. If you prefer to disable xUnit2031, let me know and I'll revert the changes and disable the analyzer.

@jaredpar
Copy link
Member

jaredpar commented Dec 2, 2024

I'm fine with a fix here.

Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

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

LGTM Thanks (iteration 4)

@jcouv jcouv merged commit fac15a8 into dotnet:main Dec 2, 2024
28 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Dec 2, 2024
@Youssef1313 Youssef1313 deleted the xunit-updates branch December 3, 2024 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure Community The pull request was submitted by a contributor who is not a Microsoft employee. untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants