Repository navigation
Migrate unit tests from xunit v2 to xunit.v3 - #8
Merged
Merged
Conversation
- xunit 2.9.3 -> xunit.v3 4.0.3 (test project is now an Exe) - Opt into the MTP dotnet test experience via global.json (required by xunit.v3 4.x on the .NET 10+ SDK); pin SDK 11.0.100 with latestFeature - Replace VSTest-only packages: drop Microsoft.NET.Test.Sdk and xunit.runner.visualstudio; coverlet.collector -> coverlet.MTP 10.1.1 Closes #5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5. Stacked on #4. The base is
net11-upgrade; retarget tomainonce #4 merges.Summary
xunit2.9.3 →xunit.v34.0.3. The test project is now<OutputType>Exe</OutputType>.dotnet test. The newglobal.jsontherefore opts into the MTPdotnet testexperience ("test": { "runner": "Microsoft.Testing.Platform" }). It also pins the SDK to11.0.100withrollForward: latestFeature.Microsoft.NET.Test.Sdk: not needed with MTPxunit.runner.visualstudio: VS and VS Code Test Explorer run MTP projects directlycoverlet.collector→coverlet.MTP10.1.1IAsyncLifetime,ITestOutputHelperorXunit.Abstractions.Command-line changes
dotnet test NimblePros.SharedKernel.slnxstill works, but VSTest-style switches don't. The MTP equivalents are:--logger trx--report-xunit-trx--collect "XPlat Code Coverage"--coverlet --coverlet-output-format cobertura--results-directory <dir>--logger trx --collect "XPlat Code Coverage"toci.ymland turns on NuGet lock files. Whichever of #7 and this PR merges second needs the test step changed to the MTP flags above, and the lock files regenerated (dotnet restore). I'll handle that once the merge order is decided.Test plan
dotnet build -c Releasesucceeds with no warningsdotnet test: 10/10 tests pass on net11.0 through MTPdotnet test --report-xunit-trx --coverlet --coverlet-output-format cobertura --results-directory artifacts/test-resultsproduces a.trxfile andcoverage.cobertura.*.xml🤖 Generated with Claude Code