Skip to content

.NET projects must use native MTP for testing #1088

Closed
1 of 1 issue completed
Closed

Description

@ptr727

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. ptr727 commented on Aug 29, 2026

    @ptr727
    OwnerAuthor

    Concrete fleet-hosted breakage found while resyncing ptr727/LanguageTags (fix: ptr727/LanguageTags#325): the hub's own centrally-hosted .github/workflows/validate-task.yml unit-test step still runs dotnet test --collect:"XPlat Code Coverage" --results-directory ./coverage, the VSTest coverlet.collector invocation. Any repo whose test project pulls in Microsoft.Testing.Platform.MSBuild transitively (e.g. xunit.v3 4.0.0+) fails outright on the .NET 10 SDK with:

    error : Testing with VSTest target is no longer supported by Microsoft.Testing.Platform on .NET 10 SDK and later. If you use dotnet test, you should opt-in to the new dotnet test experience. For more information, see https://aka.ms/dotnet-test-mtp-error
    

    This is currently blocking dependabot's own nuget-deps bump PRs on repos hitting this (ptr727/LanguageTags#323, #324).

    What actually worked in LanguageTags#325, migrating to native MTP mode per the migration guide already linked on this issue:

    • Add global.json: {"test":{"runner":"Microsoft.Testing.Platform"}}.
    • Drop xunit.runner.visualstudio (VSTest adapter, unneeded under native MTP).
    • Swap coverlet.collector for coverlet.MTP (coverlet's own VSTest data collector is silently ignored under MTP, MTP0001) with no PrivateAssets/IncludeAssets restriction, since coverlet.MTP participates in compile-time self-registration codegen and needs to stay on the compile-time closure, unlike the old build-only collector.
    • CI's unit-test step becomes dotnet test --coverlet --coverlet-output-format cobertura --results-directory ./coverage in place of --collect:"XPlat Code Coverage" — this still lands Cobertura XML at ./coverage for the existing Codecov upload step unchanged.

    Since validate-task.yml is hub-hosted (repos are meant to delete their own carried copy and call this one, per the fleet audit's hub-only finding), the hub's own unit-test step needs this same migration, plus WORKFLOW.md's D1.6 guarantee text (which currently cites dotnet test --collect:"XPlat Code Coverage" as the canonical invocation) needs updating to match. Until that lands, a repo that follows the audit's instruction to delete its local validate-task.yml copy in favor of the hub's reusable one would silently stop reporting coverage (best-effort upload, so it wouldn't fail CI, just go dark).

  2. ptr727 commented on Aug 29, 2026

    @ptr727
    OwnerAuthor

    Fleet Catalog and Hub Fix Plan

    Surveyed all 7 dotnet repos in the registry (Utilities, LanguageTags, PlexCleaner, NxWitness, PhotoCleaner, MediaTools, AudioCleaner) against their live GitHub state today (2026-08-29). This is planning output only, no repo or hub file has been changed yet. Execution happens in a follow-up session, per repo, as its own PR.

    Catalog

    Repo xunit.v3 xunit.runner.visualstudio Coverlet package global.json MTP opt-in CI test step source Status
    Utilities 3.2.2 (main) 3.1.5 coverlet.collector 10.0.1 absent local validate-task.yml Broken, fix in flight (#447 to develop, #448 to main)
    LanguageTags 4.0.0 (develop) / 3.2.2 (main) absent (develop) / 3.1.5 (main) coverlet.MTP 10.0.1 (develop) present (develop) local validate-task.yml Migrated on develop (#325), not yet promoted to main
    PlexCleaner 3.2.2 (main), bump to 4.0.0 pending 3.1.5, bump to 4.0.0 pending coverlet.collector 10.0.1 absent local validate-task.yml Broken, blocking open dependabot PRs #937/#938
    NxWitness 3.2.2, bump to 4.0.0 pending 3.1.5, bump to 4.0.0 pending coverlet.collector 10.0.1 absent local validate-task.yml Broken, blocking open dependabot PRs #545/#546
    PhotoCleaner 4.0.0 (merged via dependabot #82) 4.0.0 coverlet.collector 10.0.1 absent, rejected on purpose hub reusable validate-task.yml, pinned SHA Broken, worked around with IsTestingPlatformApplication=false to force VSTest
    MediaTools 3.2.2 3.1.5 coverlet.collector 6.0.4 absent local validate-task.yml Not yet hit, confirmed passing at this pin
    AudioCleaner 3.2.2 3.1.5 coverlet.collector 10.0.1 absent local validate-task.yml Not yet hit, confirmed passing at this pin

    Empirically confirmed (local dotnet test runs against MediaTools and AudioCleaner on .NET SDK 10.0.400): the break is specific to xunit.v3 4.0.0 and later, not merely the presence of Microsoft.Testing.Platform.MSBuild in the dependency graph. Both repos already pull that package transitively at xunit.v3 3.2.2 and both still pass under the old dotnet test --collect:"XPlat Code Coverage" invocation. This narrows and corrects the issue's own background text, which reads as if any MTP-transitive dependency triggers the failure.

    How They Diverged

    Six of the seven repos carry their own local copy of validate-task.yml rather than calling the hub's reusable workflow, so each one that hit the failure was free to fix it independently, and each picked a different answer:

    1. LanguageTags (Exempt operational repos from the baseline App-secret requirement #325, merged to develop): global.json opt-in to Microsoft.Testing.Platform, dropped xunit.runner.visualstudio, swapped coverlet.collector for coverlet.MTP with no PrivateAssets/IncludeAssets restriction, and changed the CI invocation to dotnet test --coverlet --coverlet-output-format cobertura --results-directory ./coverage. Verified locally (310/310 tests, cobertura output produced) before merge.
    2. Utilities (Fix hub bugs surfaced by the config-repo convergence #447/Promote the config-repo convergence hub fixes to main (#447) #448, open): the same global.json opt-in, but coverage via Microsoft.Testing.Extensions.CodeCoverage (Microsoft's own native MTP coverage extension) instead of coverlet, with CI invocation dotnet test --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml --results-directory ./coverage.
    3. PhotoCleaner (dependabot Develop ruleset strict "branches up to date" flag stalls bot auto-merge when sibling PR lands mid-CI #82, merged): stayed on VSTest by adding <IsTestingPlatformApplication>false</IsTestingPlatformApplication> to the test csproj. Its own OPERATIONS.md runbook states the global.json route was considered and rejected because it "breaks the --collect:\"XPlat Code Coverage\" argument this repo's CI relies on," since that argument lives in the hub's reusable workflow, not in a file PhotoCleaner controls. This is a real fix for one dependency bump but not a durable one, the next xunit.v3/Test.Sdk generation to drop the VSTest bridge entirely will break it again with no local file left to patch.
    4. PlexCleaner and NxWitness have not fixed it yet. Both have open, currently-failing dependabot PRs (Stop merge-and-release's Hub Refresh from Force-Discarding Local main #937/Add SITE_AUTH_TOKEN_ID/SITE_AUTH_TOKEN Secret Handoff to Deploy-Site Verify Hook #938 and Take the ruleset bypass list out of the fleet config entirely #545/Queue the agent-isolation rule and the vendored-tooling surface #546) blocked on the identical error, each preceded by an earlier dependabot attempt that was closed and re-rolled without success (Add markdown-exclude-globs Input to validate-task.yml #935/Promote Develop to Main #936 and Delete the stale PhotoCleaner driftNotes #537/configure.sh check mode reports a clean audit over drift it never compares #538).

    PhotoCleaner's case is the one that matters most for this issue: it is the only repo of the seven actually consuming the hub's reusable validate-task.yml (confirmed via docs/reusable-workflows.md's rollout tracker, it is the pilot for that migration), and it is also the one repo structurally unable to apply either of the two proven fixes on its own. Every future repo that converges onto the hub's reusable workflow, which is the fleet's stated direction, inherits the same bind unless the hub itself carries a working MTP invocation.

    Hub Changes Needed

    1. .github/workflows/validate-task.yml, unit-test job (line 282): replace dotnet test --collect:"XPlat Code Coverage" --results-directory ./coverage with the MTP-native form. This requires picking one coverage engine, see the open decision below, both proven forms are one line each:
      • coverlet route: dotnet test --coverlet --coverlet-output-format cobertura --results-directory ./coverage
      • Microsoft.Testing.Extensions.CodeCoverage route: dotnet test --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml --results-directory ./coverage
    2. WORKFLOW.md D1.6: update the cited canonical invocation to match, and add the global.json MTP opt-in as a stated prerequisite for a C# repo with a test project, since the hub cannot supply that file itself, it lives in each consumer's own root.
    3. A new audit check: a dotnet repo whose test project pulls in Microsoft.Testing.Platform.MSBuild (directly or transitively, in practice xunit.v3 4.0.0+) but carries no global.json test.runner opt-in is exactly the drift this issue exists to prevent finding out about only when dependabot's bump PR goes red. Making this mechanically detectable means the audit catches it ahead of the break instead of after it, which is how PlexCleaner, NxWitness, and Utilities each found out.
    4. Sequencing is safe because callers pin the reusable workflow by SHA (per the fleet's SHA-pin convention), so changing the hub's main does not retroactively break any repo still pinned to the current commit. The one exception is PhotoCleaner, which needs its own repo-side migration (the global.json plus whichever coverage package is chosen) landed in the same PR that bumps its pin to the new hub commit, mirroring how every self-migrating repo above paired its own fix with its own workflow edit.

    Open Decision

    Two structurally different, independently proven fixes exist in the fleet right now (coverlet.MTP in LanguageTags, Microsoft.Testing.Extensions.CodeCoverage in Utilities' in-flight PRs). The hub needs to standardize on one so every repo that migrates lands on the same shape, and so PhotoCleaner has exactly one route once it can no longer defer. Recommendation: coverlet.MTP, since it is the one already fully round-tripped through a merged PR, keeps the same coverage engine and Cobertura output shape the fleet's existing Codecov pipeline already assumes, and needs no change to codecov.yml semantics. This is a call for the maintainer, not something to resolve unilaterally, particularly since the Utilities PRs choosing the other route are open right now.

    Recommended Execution Order (Follow-Up Session)

    1. Land the hub fix (validate-task.yml plus WORKFLOW.md D1.6) once the coverage-engine decision is made, since it is non-breaking to every current pin.
    2. Add the audit check for the global.json prerequisite.
    3. Per-repo migration PRs, one per repo, each pairing its own global.json/package/CI change with (where applicable) a pinned-SHA bump to the new hub commit: PlexCleaner and NxWitness first (already broken, blocking real dependabot PRs), then PhotoCleaner (needs the hub fix landed first, it has no local file to patch ahead of that), then MediaTools and AudioCleaner (not yet broken, lower urgency), then LanguageTags' own develop-to-main promotion, and Utilities' own Fix hub bugs surfaced by the config-repo convergence #447/Promote the config-repo convergence hub fixes to main (#447) #448 reconciled with whichever engine the hub adopts.
    4. Track the rollout with a checkbox tracker, the same pattern used for the LF and reusable-workflows migrations, since this spans 6-7 independent repo PRs plus the hub PR.
    5. Separately from this issue: 6 of 7 dotnet repos still carry a local copy of validate-task.yml rather than the hub's reusable one, against the fleet's stated hub-only direction for that file. Worth its own tracking, not a blocking prerequisite for this fix.
  3. ptr727 commented on Aug 30, 2026

    @ptr727
    OwnerAuthor

    Hub half implemented in #1107 (feature -> develop), scoped to the two unblocking changes: the reusable validator's unit-test step and WORKFLOW.md D1.6 with its spec/project-types.json mirror. The mechanical audit check from item 3 is deferred to #1108.

    Open decision resolved: Microsoft.Testing.Extensions.CodeCoverage, not coverlet.MTP. Maintainer's call, on the reasoning that it is the platform's own direction, and Utilities' in-flight PRs already chose it.

    Two corrections to this issue's plan, both found empirically rather than by reading, on SDK 10.0.400 against a constructed two-project solution. Each matters for every per-repo migration PR that follows, so the recommended execution order should carry them.

    1. The invocation in this issue's item 1 loses coverage on a multi-test-project solution. --coverage-output coverage.cobertura.xml pins one filename for every test project, so the second silently overwrites the first: both tests pass, exit 0, and one project's coverage is simply absent from the upload. The old --collect form wrote ./coverage/<guid>/coverage.cobertura.xml and could not collide.

    2. Dropping that flag alone then uploads nothing at all. The default name it produces, <guid>.cobertura.xml, is one codecov-cli's own file finder does not match, its patterns being *coverage*.* and an exact cobertura.xml. With fail_ci_if_error: false that is silent. Migrate the Hub's Unit-Test Step to Native Microsoft.Testing.Platform #1107 therefore leaves the filename unset and prefixes each report to coverage-<guid>.cobertura.xml, keeping the guid that makes reports unique while restoring a name the finder matches. Verified by running codecov-cli's FileFinder over the tree the step actually produces.

    A version floor this issue does not mention. Microsoft.Testing.Extensions.CodeCoverage at 18.0.4, which is what a >= 18.0.0 range resolves to, is built against MTP 1.x and throws a TypeLoadException against the MTP 2.x that xunit.v3 4.0.0 carries: zero tests run, exit 7, and it still writes a well-formed Cobertura file reporting line-rate="1". Only the exit code distinguishes it from a clean run. 18.1.0 is the first MTP 2.x build, and 18.9.0 is the first on MTP 2.3.x, where every test project writes into the one shared results directory the invocation names. D1.6 states 18.9.0 as the floor.

    One wording change worth carrying into the per-repo work: the prerequisites are written as binding on a repo whose test project is MTP-based, not on every C# repo. Otherwise all seven dotnet repos fail the csharp.coverage.codecov letter assert the moment the hub change merges, for a transitional state the same change calls legitimate. A repo still on VSTest holding its existing pin is a migration owed, not drift.

    Items 3 (#1108), 4, and 5 of the execution order remain open, as do the per-repo migration PRs.

  4. ptr727 commented on Sep 2, 2026

    @ptr727
    OwnerAuthor

    The coverage half of this looks resolved on main. Checked at a9afa1d while resyncing ptr727/LanguageTags.

    .github/workflows/validate-task.yml:285 now runs the MTP invocation rather than the VSTest collector:

    $ sed -n '285p' .github/workflows/validate-task.yml
              dotnet test --coverage --coverage-output-format cobertura --results-directory ./coverage

    and spec/project-types.json's csharp.coverage.codecov check plus WORKFLOW.md D1.6 both now state the full contract, including the Microsoft.Testing.Extensions.CodeCoverage 18.9.0 floor and the reason it is load-bearing, the unset --coverage-output, and the coverage-<guid>.cobertura.xml rename for codecov-cli's file finder.

    That removes the blocker this issue created for a downstream resync. LanguageTags had been holding its local validate-task.yml copy specifically because deleting it would have reintroduced the gap, and that copy can now be deleted in favour of the hub task, which is happening in its workflow-adoption PR.

    Leaving the issue open rather than closing it, since its title is the broader "must use native MTP" migration and I only verified the coverage invocation. Flagging one thing I hit that may or may not be in scope: LanguageTags currently references coverlet.MTP rather than the Microsoft.Testing.Extensions.CodeCoverage the spec now names, and on that setup dotnet test intermittently reports Zero tests ran with exit code 5 while the test binary run directly reports 310/310. It reproduces on a pristine develop checkout on that host and not in CI, so I have not concluded it is a hub problem. I will report back on that issue once the package swap lands, since the swap is the thing D1.6 predicts should change the behaviour.

  5. ptr727 commented on Sep 2, 2026

    @ptr727
    OwnerAuthor

    Reporting back as promised, now that the package swap has landed and a real release has run.

    ptr727/LanguageTags swapped coverlet.MTP for Microsoft.Testing.Extensions.CodeCoverage 18.9.0 and adopted the hub's validate-task.yml (ptr727/LanguageTags#336, merged). The hub's own coverage invocation then ran in release run 33592206733:

    Validate job / Unit test job    Test run summary: Passed!
                                      total: 310
                                      failed: 0
                                      succeeded: 310
    

    So the coverage half of this issue is confirmed working end to end from a downstream adopter, not just present in the hub's source. That repository's local validate-task.yml copy is deleted and it now reaches the hub task.

    On the Zero tests ran symptom I flagged in my previous comment: it was not a hub problem, and the package swap did not cause or cure it. It reproduces on that host with coverlet.MTP and with Microsoft.Testing.Extensions.CodeCoverage alike, and it reproduces on a pristine develop checkout predating any of this work, while the test binary invoked directly reports 310/310 every time. CI has never shown it. It is a local environment condition on that one machine, so there is nothing here for the hub to act on and I am withdrawing it as a possible hub defect rather than leaving it standing.

    Leaving the issue open, since its title covers the broader native-MTP migration and I have only verified the coverage invocation.

  6. ptr727 commented on Sep 3, 2026

    @ptr727
    OwnerAuthor

    Scope check against the current tree, so the remaining work is not mistaken for the whole issue.

    Hub side is done. .github/workflows/validate-task.yml runs the native MTP invocation (dotnet test --coverage --coverage-output-format cobertura --results-directory ./coverage), shipped in 67731c4b ("Migrate the Hub's Unit-Test Step to Native Microsoft.Testing.Platform (#1107)") and promoted to main via f3b4cc98. WORKFLOW.md D1.6 now carries the full MTP contract: the 18.9.0 floor for Microsoft.Testing.Extensions.CodeCoverage, the unset --coverage-output, and the coverage-<guid>.cobertura.xml rename.

    What is still live is downstream rollout, which is the broader migration this issue's title names: the other .NET repos each still need their own global.json runner opt-in, package swap, and VSTest adapter removal.

    Leaving open for that rollout. Anyone picking this up should treat it as a per-repo sweep, not a hub change.

  7. added
    prose
    on Sep 5, 2026
  8. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

    Decision needed (decision triage, 2026-11-01)

    Question: The hub half of the native MTP migration is done and 6 of the 7 .NET repositories have migrated: close this in the hub with the last repository (AudioCleaner) tracked there, or keep it open until AudioCleaner migrates?

    Options, recommended first:

    1. Close it, file AudioCleaner's migration there (recommended): The remainder is a per-repo change in a repository not broken today, which belongs where it lands, and the 2026-10-23 decision on Review Anthropic's Code Review Practices Against the Fleet Review Workflow for Cost and Backlog #3391 closes hub trackers. No work in flight.
    2. Keep open until AudioCleaner migrates: One place tracks the rollout, but it sits as a one-repo tracker possibly for long, since AudioCleaner is pre-CI. No work in flight.
    3. Close it, let AudioCleaner's standup or resync carry it: Files nothing, but nothing mechanical surfaces the gap (the audit runs no project-type check), so the first signal would be a red xunit.v3 4.x bump. No work in flight.

    Evidence: Hub fix #1107 (67731c4), promoted in f3b4cc9, WORKFLOW.md D1.6 states the 18.9.0 floor. Utilities, LanguageTags, PlexCleaner, NxWitness, PhotoCleaner, MediaTools main carry the MTP global.json runner and Microsoft.Testing.Extensions.CodeCoverage. AudioCleaner has no global.json and still holds xunit.v3 3.2.2, xunit.runner.visualstudio, coverlet.collector (below the 4.0.0 break), and its registry entry reads "Work-in-progress: pre-CI". #1108 closed 2026-10-23. AUDIT.md:73: audit.py evaluates no project-type check.

    Blocks: none

  9. added
    decision
    on Nov 1, 2026
  10. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

    Maintainer answer (decision triage, 2026-11-01): Option 1: close here and track AudioCleaner's migration in that repository, filed as https://github.com/ptr727/AudioCleaner/issues/21.

  11. removed
    decision
    on Nov 1, 2026
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

    prose

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions