[rel/18.10] Isolate code coverage files in published output - #16476
Azat Mukhametshin (azat-msft) merged 4 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2e7cccb0-dd63-4239-a2c9-8d0508208357
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
There was a problem hiding this comment.
🔵 Needs a closer look
Normalize PublishDir before appending Microsoft.CodeCoverage so WASM exclusion works without a trailing separator.
Pull request overview
This PR isolates Microsoft.CodeCoverage files from published application output and WASM bundles.
Changes:
- Publishes coverage tools and dependencies under
Microsoft.CodeCoverage. - Adds publish and discovery tests.
- Documents usage and cleanup requirements.
File summaries
| File | Summary |
|---|---|
test/Microsoft.TestPlatform.Acceptance.IntegrationTests/CodeCoveragePublishTests.cs |
Validates isolated publishing and coverage discovery. |
src/package/Microsoft.CodeCoverage/README.md |
Documents published usage and cleanup. |
src/package/Microsoft.CodeCoverage/Microsoft.CodeCoverage.targets |
Relocates assets and excludes them from WASM bundles. |
docs/analyze.md |
Updates code coverage guidance. |
Review details
Suppressed comments (1)
src/package/Microsoft.CodeCoverage/Microsoft.CodeCoverage.targets:37
- The WASM SDK populates
WasmAssembliesToBundlefrom$(PublishDir)\**\*.dllduring nested publish, but this removal pattern concatenatesMicrosoft.CodeCoveragedirectly to$(PublishDir). IfPublishDiris supplied without a trailing separator (as it is in the test's-p:PublishDirinvocation), the pattern becomes<publish>Microsoft.CodeCoverage/**/*.dlland the coverage assemblies remain in the WASM bundle. Normalize the property withEnsureTrailingSlash(or add an explicit separator) before appending the subdirectory.
<WasmAssembliesToBundle Remove="$(PublishDir)Microsoft.CodeCoverage/**/*.dll" />
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
|
Fixed the PublishDir edge case from the latest review in 1338ece. The WASM exclusion now uses EnsureTrailingSlash before adding the coverage subfolder. The existing regression tests exercise paths both with and without the final separator; they failed before the fix and pass with it. The matching main change is 225875b in #16483. |
fd447e0
into
microsoft:rel/18.10
Updated [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 18.10.0 to 18.10.1. <details> <summary>Release notes</summary> _Sourced from [Microsoft.NET.Test.Sdk's releases](https://github.com/microsoft/vstest/releases)._ ## 18.10.1 ## What's Changed * Isolate code coverage files in published output by @azat-msft in microsoft/vstest#16476 **Full Changelog**: microsoft/vstest@v18.10.0...v18.10.1 Commits viewable in [compare view](microsoft/vstest@v18.10.0...v18.10.1). </details> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details>
Updated [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 18.10.0 to 18.10.1. <details> <summary>Release notes</summary> _Sourced from [Microsoft.NET.Test.Sdk's releases](https://github.com/microsoft/vstest/releases)._ ## 18.10.1 ## What's Changed * Isolate code coverage files in published output by @azat-msft in microsoft/vstest#16476 **Full Changelog**: microsoft/vstest@v18.10.0...v18.10.1 Commits viewable in [compare view](microsoft/vstest@v18.10.0...v18.10.1). </details> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Addresses 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.