Skip to content

Scope coverage to tested assemblies - #11015

Merged
Amaury Levé (Evangelink) merged 2 commits into
mainfrom
dev/amauryleve/scope-project-coverage
Sep 4, 2026
Merged

Scope coverage to tested assemblies#11015
Amaury Levé (Evangelink) merged 2 commits into
mainfrom
dev/amauryleve/scope-project-coverage

Conversation

@Evangelink

Copy link
Copy Markdown
Member

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

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
Copilot AI balanced review requested due to automatic review settings September 3, 2026 14:20
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🧪 Expert test review — PR #11015

No new or modified test methods were identified in the changed regions of this PR. The changes in this PR are limited to build infrastructure (test/Directory.Build.targets and test/coverage.config, which generates per-project code coverage settings) — no .cs test source files were touched. Nothing to review.

Re-run with /review-tests.

🤖 Automated content by GitHub Copilot. Generated by the Test Reviewer on PR (on open / sync) workflow. · auto · 31.1 AIC · ⌖ 2.5 AIC · ⊞ 16.9K · [◷]( · )

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.

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 Medium severity

New issues introduced by this change (1)
Severity Finding
Medium severity 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.

Comment thread test/Directory.Build.targets
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
Copilot AI review requested due to automatic review settings September 3, 2026 14:33
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🧵 Parallel-safety audit — PR #11015

Nothing audited here touches process-global state, shared filesystem paths, or [ResourceLock] / [DoNotParallelize] declarations. This PR only changes test/Directory.Build.targets (generating a per-project coverage.config at build time) and removes the old shared test/coverage.config. No test methods, lifecycle members, fixtures, or parallelization attributes were changed. Nothing to flag for parallel-safety.

Re-run with /parallel-audit.

🤖 Automated content by GitHub Copilot. Generated by the Parallel-safety audit on PR (on open / sync) workflow. · auto · 37.6 AIC · ⌖ 5.29 AIC · ⊞ 24.8K · [◷]( · )

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🧪 Expert test review — PR #11015

No new or modified test methods were identified in the changed regions of this PR. The changes touch only test/Directory.Build.targets (MSBuild code-coverage configuration generation) and remove test/coverage.config; no test source files (.cs) were modified. Nothing to review.

Re-run with /review-tests.

🤖 Automated content by GitHub Copilot. Generated by the Test Reviewer on PR (on open / sync) workflow. · auto · 40.2 AIC · ⌖ 2.49 AIC · ⊞ 16.9K · [◷]( · )

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.

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
Medium severity test/​Directory.Build.targets — Register the generated settings file in FileWrites; otherwise MSBuild's Clean target does not… View resolved comment

@Evangelink Amaury Levé (Evangelink) added the state/needs-review Awaiting review from the team. label Sep 3, 2026
@Evangelink
Amaury Levé (Evangelink) merged commit 0494cbe into main Sep 4, 2026
49 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the dev/amauryleve/scope-project-coverage branch September 4, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state/needs-review Awaiting review from the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants