Migrate tests to xunit.v3 4.x on Microsoft Testing Platform v2
Merged
BR
19d ago+30+30+01234567890123456789-31-31-01234567890123456789
Motivation
xunit.v3 4.x uses Microsoft Testing Platform (MTP) v2 by default, so the VSTest adapter, test SDK, and VSTest loggers are no longer needed.
Modifications
- Update
xunit.v3to 4.0.3 (pulls inxunit.v3.mtp-v2) and removeMicrosoft.NET.Test.Sdk,xunit.runner.visualstudio,coverlet.collector, andJUnitTestLogger - Collect coverage with
coverlet.MTP10.1.0 (Cobertura output, same format as before) - Report results to GitHub Actions with
GitHubActionsTestLogger3.0.5, which supports MTP. It has no .NET Framework build, so it is referenced for .NET targets only - Opt
dotnet testinto MTP mode inglobal.json("test": { "runner": "Microsoft.Testing.Platform" }), required by the .NET 10+ SDK - Resolve xUnit1069 on
MalformedFrameInput: the test is now async and runs the synchronousCopyToon a worker thread withTestContext.Current.CancellationToken, so the timeout ends the test even if a regression causes a hang inside a singleReadcall. It still exercises the synchronous path - Build workflow:
- Replace
--logger/--collectwith--report-github --coverlet --coverlet-output-format cobertura --results-directory "${{ github.workspace }}/TestResults"and update the coverage upload paths - Remove the
VSTEST_DISABLE_ARTIFACTS_DIRECTORY_VERIFICATIONarm64 workaround - Windows job: target
--project Snappier.Testsbecause MTP-modedotnet testrejects--runtimeon a solution (NETSDK1134); dropRunConfiguration.DisableAppDomain; no--report-githubsince the reporter has no net48 build; instead, xunit.v3's built-in TRX reporter writesSnappier.Tests-net48-<arch>.trx, uploaded as thetest-results-net4-<arch>artifact (also on test failure) - Coverage cleanup: coverlet.MTP writes Windows paths with forward slashes, so the
sedrewrite now matches either slash
- Replace
Reviewer notes
- Verified locally: build has no warnings; tests pass on net8.0 and net10.0 (281) and net48 x64/x86 (265), each producing a Cobertura file. The workflow itself has not run yet.
- The Windows (net48) jobs no longer add a GitHub Actions test summary; their results are in the
test-results-net4-<arch>TRX artifacts.
š¤ Generated with Claude Code