Skip to content

Migrate test infrastructure to Microsoft Testing Platform with xUnit v3 - #882

Merged
sebastienros merged 4 commits into
mainfrom
copilot/update-to-microsoft-testing-platform
Nov 25, 2025
Merged

sebastienros merged 4 commits into
mainfrom
copilot/update-to-microsoft-testing-platform

Conversation

Copilot AI commented Nov 25, 2025 •

Copy link
Copy Markdown
Contributor

Migrates from xUnit 2.x with VSTest runner to xUnit v3 with Microsoft Testing Platform (MTP v2).

Changes

Package updates (Directory.Packages.props)

  • Replace xunit 2.9.3 → xunit.v3.core.mtp-v2 3.2.0 + xunit.v3.assert 3.2.0
  • Remove xunit.runner.visualstudio 3.1.5
  • Remove GitHubActionsTestLogger 3.0.1 (not compatible with MTP)

Test project (Fluid.Tests.csproj)

  • Update package references to xUnit v3 packages
  • Remove VSTest runner configuration
  • Remove GitHubActionsTestLogger reference

Configuration

  • global.json: Add "test": { "runner": "Microsoft.Testing.Platform" } for .NET 10+ compatibility
  • Delete xunit.runner.json (obsolete with MTP)

GitHub Workflows

  • build.yml: Remove --logger GitHubActions option (not supported by MTP)
  • pr.yml: Remove --logger GitHubActions option (not supported by MTP)

Code compatibility fixes

  • LogTests.cs: Remove using Xunit.Abstractions; — ITestOutputHelper moved to Xunit namespace in v3
  • .editorconfig: Set xUnit1051 (CancellationToken) to suggestion level

All 1361 tests pass across net8.0, net9.0, and net10.0.

Original prompt

Update the project to use Microsoft Testing Platform and xunit.v3.core.mtp-v2

This change migrates the test infrastructure from the traditional xUnit runner to Microsoft Testing Platform:

  1. Update Directory.Packages.props to replace xunit 2.9.3 with xunit.v3.core.mtp-v2 3.0.0
  2. Remove xunit.runner.visualstudio 3.1.5 dependency (not needed with MTP)
  3. Update Fluid.Tests.csproj to use the new package instead of xunit.runner.visualstudio
  4. Remove xunit.runner.json configuration file as it's no longer needed

The test code remains compatible with xUnit v3 and requires no changes.

This pull request was created as a result of the following prompt from Copilot chat.

Update the project to use Microsoft Testing Platform and xunit.v3.core.mtp-v2

This change migrates the test infrastructure from the traditional xUnit runner to Microsoft Testing Platform:

  1. Update Directory.Packages.props to replace xunit 2.9.3 with xunit.v3.core.mtp-v2 3.0.0
  2. Remove xunit.runner.visualstudio 3.1.5 dependency (not needed with MTP)
  3. Update Fluid.Tests.csproj to use the new package instead of xunit.runner.visualstudio
  4. Remove xunit.runner.json configuration file as it's no longer needed

The test code remains compatible with xUnit v3 and requires no changes.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: sebastienros <1165805+sebastienros@users.noreply.github.com>
@sebastienros
sebastienros marked this pull request as ready for review November 25, 2025 01:15
Copilot AI changed the title [WIP] Update project to use Microsoft Testing Platform and xunit.v3.core.mtp-v2 Migrate test infrastructure to Microsoft Testing Platform with xUnit v3 Nov 25, 2025
Copilot AI requested a review from sebastienros November 25, 2025 01:16
@sebastienros

Copy link
Copy Markdown
Owner

@copilot Update the github workflows, they seem to use invalid command lines to run the tests

Co-authored-by: sebastienros <1165805+sebastienros@users.noreply.github.com>

Copilot AI commented Nov 25, 2025

Copy link
Copy Markdown
Contributor Author

@copilot Update the github workflows, they seem to use invalid command lines to run the tests

Updated the GitHub workflows in commit b2e715f. Removed the --logger GitHubActions option from both build.yml and pr.yml since it's not supported by Microsoft Testing Platform. Also removed the unused GitHubActionsTestLogger package from the project.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants