Scope coverage to tested assemblies - #11015
Conversation
Generate coverage settings from each test project's direct production references so per-run totals exclude shared test-host infrastructure. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 31fed026-1119-4585-8c52-b5d486a81ad8
🧪 Expert test review — PR #11015No new or modified test methods were identified in the changed regions of this PR. The changes in this PR are limited to build infrastructure ( Re-run with
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The generated settings file must be registered in FileWrites so Clean removes it.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
test/Directory.Build.targets — Register the generated settings file in FileWrites; otherwise MSBuild's Clean target does not… |
What changed in this PR
Scopes coverage to production assemblies directly referenced by each test project.
Changes:
- Generates project-specific coverage settings.
- Excludes shared test infrastructure.
- Removes the repository-wide coverage allowlist.
| File | Description |
|---|---|
test/Directory.Build.targets |
Generates scoped coverage settings. The generated file must be registered in FileWrites for cleanup. |
test/coverage.config |
Removes the obsolete global allowlist. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Register each generated coverage configuration in FileWrites so MSBuild Clean removes the intermediate artifact. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 31fed026-1119-4585-8c52-b5d486a81ad8
🧵 Parallel-safety audit — PR #11015Nothing audited here touches process-global state, shared filesystem paths, or Re-run with
|
🧪 Expert test review — PR #11015No new or modified test methods were identified in the changed regions of this PR. The changes touch only Re-run with
|
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Approval assessments were split, so final human review is warranted.
Review tier: Balanced
Findings: None
Issues resolved since last review (1)
| Severity | Finding |
|---|---|
test/Directory.Build.targets — Register the generated settings file in FileWrites; otherwise MSBuild's Clean target does not… View resolved comment |

Generate coverage settings for each test assembly from its direct production project references. This keeps per-run coverage totals focused on the assemblies actually under test instead of including shared crash dump, hang dump, reporting, and platform infrastructure.
The generated settings preserve the existing instrumentation options, handle MSTest projects whose assembly names differ from their project names, and allow source-linked suites with no standalone production assembly to produce an empty module scope. Shared test-host project references are explicitly marked as infrastructure and excluded. The obsolete repository-wide coverage allowlist is removed.
Related issue: N/A