Skip to content

chore(tests): migrate test projects to Microsoft.Testing.Platform v2 #605

Closed

Description

@adrianhall

Follow-up to #591.

Background

xUnit.net v3 4.0 makes Microsoft.Testing.Platform (MTP) v2 the default runner, and the .NET 10 SDK refuses to run MTP projects through the VSTest target ("Testing with VSTest target is no longer supported by Microsoft.Testing.Platform on .NET 10 SDK and later").

To keep the upgrade small, #591 uses the xunit.v3.mtp-off / xunit.v3.core.mtp-off package variants so dotnet test, --logger trx, and --collect:"XPlat Code Coverage" keep working unchanged.

Proposed work

  • Move test projects to MTP v2 (xunit.v3 / xunit.v3.core without .mtp-off) and drop Microsoft.NET.Test.Sdk / xunit.runner.visualstudio where no longer needed.
  • Opt in to the MTP dotnet test experience (global.json test.runner = Microsoft.Testing.Platform).
  • Replace --logger trx and --collect:"XPlat Code Coverage" in .github/workflows/build-library.yml with the MTP equivalents (e.g. --report-xunit-xml, --report-trx, --coverage/Microsoft.Testing.Extensions.CodeCoverage or coverlet MTP).
  • Confirm TestResults/SummaryGithub.md and the coverage artifact upload still work, and that test counts match.
  • Update CONTRIBUTING.md/docs with any changed test-run instructions.

References: https://xunit.net/docs/getting-started/v3/microsoft-testing-platform

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions