Skip to content

Isolate code coverage files in published output - #16483

Merged
Azat Mukhametshin (azat-msft) merged 3 commits into
microsoft:mainfrom
azat-msft:azat-msft-coverage-isolated-publish-main
Sep 14, 2026
Merged

Azat Mukhametshin (azat-msft) merged 3 commits into
microsoft:mainfrom
azat-msft:azat-msft-coverage-isolated-publish-main

Conversation

@azat-msft

Copy link
Copy Markdown
Member

Main-branch version of #16476, addressing the publish failures in microsoft/testfx#11178.

Publish coverage tools and their private dependencies under Microsoft.CodeCoverage instead of the application root. Keep those tools out of the WASM bundle and document the one-time cleanup needed for existing publish folders. Includes the corrected cross-platform test matrix.

Port the isolation change and corrected cross-platform test matrix from microsoft#16476 to main.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2e7cccb0-dd63-4239-a2c9-8d0508208357
Copilot AI lite review requested due to automatic review settings September 14, 2026 09:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved cross-platform path, collector discovery, and Windows-only test issues block approval.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR isolates code coverage tooling under Microsoft.CodeCoverage, prevents WASM bundling, and documents the published layout and cleanup process.

Changes:

  • Relocates coverage artifacts and private dependencies.
  • Excludes coverage assemblies from WASM output.
  • Adds publish and coverage integration tests.
  • Updates usage and migration documentation.
File summaries
File Review findings
test/Microsoft.TestPlatform.Acceptance.IntegrationTests/CodeCoveragePublishTests.cs Critical (1 vote): Collector discovery requires /TestAdapterPath or recursive discovery support. Critical (1 vote): Add the Windows-only category for the built-in coverage test.
src/package/Microsoft.CodeCoverage/README.md Nit (1 vote): Include --TestAdapterPath in the documented command or update discovery behavior.
src/package/Microsoft.CodeCoverage/Microsoft.CodeCoverage.targets Critical (1 vote): Use / in RelativePath for portable publish layout. Moderate (1 vote): Use / in the WASM removal glob.
Review details

Suppressed comments (2)

src/package/Microsoft.CodeCoverage/Microsoft.CodeCoverage.targets:37

  • This removal pattern uses Windows separators, while the WASM item specs are emitted with the platform's path separators. On Unix it will not match the files under Microsoft.CodeCoverage, leaving the collector DLLs in the WASM bundle even after the publish layout is corrected. Use / in the glob (MSBuild accepts it on Windows too).
      <WasmAssembliesToBundle Remove="$(PublishDir)Microsoft.CodeCoverage\**\*.dll" />

src/package/Microsoft.CodeCoverage/README.md:26

  • The example omits --TestAdapterPath, but the current .NET test host does not recursively discover Microsoft.VisualStudio.TraceDataCollector.dll from the new publish/Microsoft.CodeCoverage child directory. As written, this documented command will run without the coverage collector; include the published subdirectory in the example or update the runner discovery behavior before documenting the no-path form.
dotnet vstest publish/Tests.dll --collect:"Code Coverage"
  • Files reviewed: 3/3 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Use portable publish paths, correct the coverage platform documentation, and explain the existing recursive collector discovery.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2e7cccb0-dd63-4239-a2c9-8d0508208357
Copilot AI review requested due to automatic review settings September 14, 2026 10:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved review comments were identified.

Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Cover publish paths with and without a trailing separator in the existing isolation regression tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2e7cccb0-dd63-4239-a2c9-8d0508208357
Copilot AI review requested due to automatic review settings September 14, 2026 10:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved blocking issues were identified in the reviewed changes.

Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

This was referenced Nov 30, 2026
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.

3 participants