Skip to content

[rel/18.10] Isolate code coverage files in published output - #16476

Merged
Azat Mukhametshin (azat-msft) merged 4 commits into
microsoft:rel/18.10from
azat-msft:azat-msft-coverage-isolated-publish
Sep 14, 2026
Merged

Azat Mukhametshin (azat-msft) merged 4 commits into
microsoft:rel/18.10from
azat-msft:azat-msft-coverage-isolated-publish

Conversation

@azat-msft

Copy link
Copy Markdown
Member

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.

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

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.

🔵 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 WasmAssembliesToBundle from $(PublishDir)\**\*.dll during nested publish, but this removal pattern concatenates Microsoft.CodeCoverage directly to $(PublishDir). If PublishDir is supplied without a trailing separator (as it is in the test's -p:PublishDir invocation), the pattern becomes <publish>Microsoft.CodeCoverage/**/*.dll and the coverage assemblies remain in the WASM bundle. Normalize the property with EnsureTrailingSlash (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
@azat-msft

Copy link
Copy Markdown
Member Author

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.

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.

🔵 Needs a closer look

Publish-path and WASM integration changes warrant final human review.

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

@azat-msft
Azat Mukhametshin (azat-msft) marked this pull request as ready for review September 14, 2026 11:21
@azat-msft
Azat Mukhametshin (azat-msft) merged commit fd447e0 into microsoft:rel/18.10 Sep 14, 2026
27 checks passed
ptr727-codegen Bot added a commit to ptr727/Utilities that referenced this pull request Sep 15, 2026
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>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Microsoft.NET.Test.Sdk&package-manager=nuget&previous-version=18.10.0&new-version=18.10.1)](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>
ptr727-codegen Bot pushed a commit to ptr727/Utilities that referenced this pull request Sep 15, 2026
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>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Microsoft.NET.Test.Sdk&package-manager=nuget&previous-version=18.10.0&new-version=18.10.1)](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>
This was referenced Sep 16, 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