Skip to content

Add first-class MSTest (and generic MTP) support to Microsoft.DotNet.Helix.Sdk #8926

Closed as not planned

Description

Summary

Today neither MSTest, NUnit, nor pure-MTP test projects have a first-class item type in Microsoft.DotNet.Helix.Sdk. Only xUnit v2 (XUnitProject) and xUnit v3 (XUnitV3Project) do. Users sending MSTest to Helix have to hand-author <HelixWorkItem> entries with custom dotnet test --logger trx commands, payload directory plumbing, and TRX result wiring — every team reinvents the same boilerplate.

This issue tracks adding first-class MSTest support on Helix by contributing two new MSBuild item types to dotnet/arcade:

  • MTPProject — generic primitive for any Microsoft.Testing.Platform-based test project (MSTest 4.x with MTP, NUnit MTP runner, TUnit, custom MTP).
  • MSTestProject — thin discoverability shim that folds into MTPProject before any target runs.

Both produce a single Helix work item per project (or per (project, AdditionalProperties) combination for multi-targeted projects). The minimal user experience becomes:

<ItemGroup>
  <MSTestProject Include="..\test\MyApp.Tests\MyApp.Tests.csproj" />
</ItemGroup>

This issue exists in microsoft/testfx to make the change discoverable to MSTest users; the actual PR lives in dotnet/arcade.

Design

Mirrors the existing XUnitV3Project pattern in Microsoft.DotNet.Helix.Sdk:

Piece Purpose
src/Microsoft.DotNet.Helix/Sdk/CreateMTPWorkItems.cs C# MSBuild task. Mirrors CreateXUnitV3WorkItems. Generates the per-work-item dotnet exec command. Dedups by (Identity, AdditionalProperties).
src/Microsoft.DotNet.Helix/Sdk/tools/mtp-runner/MTPRunner.props Self-registers into _HelixMonoQueueTargets (3 lines, mirrors XUnitV3Runner.props).
src/Microsoft.DotNet.Helix/Sdk/tools/mtp-runner/MTPRunner.targets Orchestrates Restore / Publish / CreateMTPWorkItems and folds MSTestProject into MTPProject. Reuses the generic xunit-runner/XUnitPublish.targets helper.
One-line UsingTask add to src/Microsoft.DotNet.Helix/Sdk/tools/Microsoft.DotNet.Helix.Sdk.props Registers the new C# task.
Readme.md section Usage table, prerequisites (Microsoft.Testing.Extensions.TrxReport — already included by MSTest.Sdk), minimal example, multi-TFM example, AzDO reporter caveat.

Generated command

dotnet exec --roll-forward Major \
    --runtimeconfig MyApp.Tests.runtimeconfig.json \
    --depsfile MyApp.Tests.deps.json \
    MyApp.Tests.dll \
    --results-directory . --report-trx --report-trx-filename testResults.trx

The TRX file is consumed by arcade's existing TRXFormat Python parser (no new parser needed) and survives both legacy mode and EnableHelixJobMonitor=true (the monitor sweeps *.trx).

Key design decisions

  • Two item types: MTPProject (generic) + MSTestProject (discoverability shim). MSTest is the headline reason but the runtime command is framework-agnostic, so a generic primitive avoids duplication when NUnit/TUnit follow.
  • MTP-only runner, no VSTest fallback. MSTest 4.x defaults to MTP; VSTest is being deprecated; legacy users keep using raw <HelixWorkItem>.
  • Result format = TRX, parsed natively by arcade. No transcoding.
  • No --report-azdo in the generated command. The AzDO reporter requires both --report-azdo and TF_BUILD=true to activate, so omitting the flag means there is zero risk of producing a duplicate Azure DevOps test run on top of the one the Helix SDK already opens via StartAzurePipelinesTestRun.
  • MSTestProject covers only MTP-enabled MSTest (i.e. MSTest.Sdk or EnableMSTestRunner=true). Legacy VSTest-based MSTest stays out of scope — users should migrate or keep using raw <HelixWorkItem>.

Out of scope for the first PR (future tracks)

  • Test sharding via --list-tests + --treenode-filter.
  • A Microsoft.Testing.Extensions.HelixReport MTP extension that streams dumps to $HELIX_DUMP_FOLDER and live-reports progress to the Helix work item — this would live in microsoft/testfx once the arcade primitive lands.
  • HELIX_DUMP_FOLDER awareness in CrashDump/HangDump extensions.

Status

Drafts complete and reviewed locally. Files are staged for an arcade PR.

Acceptance criteria

  • PR opened against dotnet/arcade containing the files above.
  • dotnet/arcade builds with the new task and runner targets.
  • A smoke helix.proj using <MSTestProject> produces a valid Helix work item and a parsed TRX run in an Azure DevOps pipeline.
  • Readme.md section is published.
  • Tracked back to this issue once the arcade PR is in flight.

Activity

  1. Evangelink commented on Jul 5, 2026

    @Evangelink
    MemberAuthor

    Probably not worth handling anything here but everything would be done on arcade repo

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions