Skip to content

build: migrate tests to Microsoft.Testing.Platform v2#28

Merged
crazycrank merged 3 commits into
masterfrom
build/mtp-v2-test-migration
Jun 14, 2026
Merged

build: migrate tests to Microsoft.Testing.Platform v2#28
crazycrank merged 3 commits into
masterfrom
build/mtp-v2-test-migration

Conversation

@crazycrank

Copy link
Copy Markdown
Contributor

What

Migrates the test suite from VSTest to Microsoft.Testing.Platform (MTP) v2.

  • xunit.v3xunit.v3.mtp-v2; removed Microsoft.NET.Test.Sdk + xunit.runner.visualstudio (the MTP in-proc runner replaces them).
  • coverlet.collectorMicrosoft.Testing.Extensions.CodeCoverage (native MTP coverage).
  • Opt into the MTP runner via global.json (test.runner); test projects are now OutputType=Exe.
  • OutputDirectoryAssemblyResolver — the MTP self-host resolves runtime assemblies strictly from .deps.json. Scribe is referenced as a Scribe.Sdk Library ProjectReference, which is not a runtime dependency, so tests that instantiate generators touching Scribe failed under MTP (VSTest's testhost had masked this via directory probing). This ITestPipelineStartup hook probes the output directory to resolve them.
  • Stripped the ambiguous netstandard2.0/framework system refs in Scribe.Tests (required once ValueTask is referenced via xUnit's ITestPipelineStartup).

CI

dotnet test --solution now emits native xUnit CTRF results (no extra package) and Cobertura coverage, rendered to the GitHub job summary via ctrf-io/github-test-reporter and ReportGenerator. Replaces the old TRX logger + artifact upload.

Verification

Scribe.Tests: 497/497 pass under MTP; CTRF + Cobertura emission confirmed locally.

🤖 Generated with Claude Code

crazycrank and others added 3 commits June 13, 2026 16:06
Swap the VSTest stack for Microsoft.Testing.Platform (MTP) v2:

- xunit.v3 -> xunit.v3.mtp-v2; drop Microsoft.NET.Test.Sdk and
  xunit.runner.visualstudio (the MTP in-proc runner replaces them).
- coverlet.collector -> Microsoft.Testing.Extensions.CodeCoverage
  (native MTP coverage).
- Opt into the MTP runner via global.json (test.runner) and set
  OutputType=Exe for test projects.
- Add OutputDirectoryAssemblyResolver: the MTP self-host resolves runtime
  assemblies strictly from .deps.json, and Scribe (a Scribe.Sdk Library)
  is referenced as a ProjectReference, so it is not a runtime dep. This
  xUnit pipeline-startup hook probes the output directory so generators
  can load Scribe at test time.
- Strip the netstandard2.0/framework ambiguous system refs in Scribe.Tests
  (needed once ValueTask is referenced via xUnit ITestPipelineStartup).
- CI: run tests via `dotnet test --solution`, emit native xUnit CTRF and
  Cobertura coverage, and render both to the job summary via
  ctrf-io/github-test-reporter and danielpalme/ReportGenerator-GitHub-Action.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Surface Directory.Build.props/.targets, Directory.Packages.props, and
global.json under Solution Items.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@crazycrank crazycrank merged commit b3dfa63 into master Jun 14, 2026
2 checks passed
@crazycrank crazycrank deleted the build/mtp-v2-test-migration branch June 14, 2026 02:01
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.

1 participant