Skip to content

Migrate test suites from the VSTest bridge to Microsoft Testing Platform #581

Description

@jeremydmiller

Follow-up to #577, which moved every test suite to xunit v3 but deliberately stayed on the VSTest bridge (xunit.runner.visualstudio + Microsoft.NET.Test.Sdk) to keep the migration reviewable.

Now that v3 is in, Microsoft Testing Platform (MTP) is unblocked. xunit v3 ships MTP support in the box.

Why it was deferred

Two concrete blockers, both still true:

  1. coverlet.collector is VSTest-only. Six projects reference it. MTP needs Microsoft.Testing.Extensions.CodeCoverage instead, which is a different collector with different output and different CI wiring.
  2. Nuke's DotNetTest assumes VSTest argument shapes. Under MTP, dotnet test changes how arguments are passed (-- separator, different filter syntax). The seven DotNetTest calls in build/Build.cs would need review, and TestCodegenFSharp's .SetFramework("net9.0") in particular.

Why it's worth doing

  • Test projects run as their own executables — faster startup, no testhost indirection.
  • Better diagnostics and native support for xunit v3's richer reporting.
  • VSTest is in maintenance; MTP is where .NET testing is going.

Scope

  • Swap coverlet.collectorMicrosoft.Testing.Extensions.CodeCoverage across the 6 projects that use it
  • Set <UseMicrosoftTestingPlatformRunner> / <TestingPlatformDotnetTestSupport> in the test projects
  • Review all DotNetTest calls in build/Build.cs for argument compatibility
  • Confirm [assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly)] in CodegenTests and CommandLineTests is still honored (these two must not run concurrently — see chore: migrate tests to xunit v3 #577)
  • Verify test counts against the current baseline: CoreTests 475, CodegenTests 419, CommandLineTests 295, EventTests 648, EventStoreTests 72, CodegenTests.FSharp 1, JasperFx.SourceGenerator.Tests 19, JasperFx.Events.SourceGenerator.Tests 26, JasperFx.Aspire.Tests 51

Not urgent — the VSTest bridge works fine today.

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