Repository navigation
Isolate code coverage files in published output - #16483
Merged
Azat Mukhametshin (azat-msft) merged 3 commits intoSep 14, 2026
Merged
Azat Mukhametshin (azat-msft) merged 3 commits into
Azat Mukhametshin (azat-msft) merged 3 commits into
Conversation
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
Contributor
There was a problem hiding this comment.
🟡 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 discoverMicrosoft.VisualStudio.TraceDataCollector.dllfrom the newpublish/Microsoft.CodeCoveragechild 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
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
Jakub Jareš (nohwnd)
approved these changes
Sep 14, 2026
Azat Mukhametshin (azat-msft)
merged commit Sep 14, 2026
ee1fa7a
into
microsoft:main
22 checks passed
This was referenced Nov 12, 2026
Merged
This was referenced Nov 30, 2026
Open
Open
Open
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Main-branch version of #16476, addressing the publish failures in microsoft/testfx#11178.
Publish coverage tools and their private dependencies under
Microsoft.CodeCoverageinstead 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.