Skip to content

Keep a coverage report per target framework - #53

Merged
iancooper merged 3 commits into
mainfrom
fix/19-per-tfm-coverage-reports
Oct 19, 2026
Merged

iancooper merged 3 commits into
mainfrom
fix/19-per-tfm-coverage-reports

Conversation

@iancooper

Copy link
Copy Markdown
Member

Replaces #19 on Microsoft Testing Platform.

The defect

__GenerateCoverageReports writes every TFM of a project to one directory, artifacts/coverage-reports/<Project>/. Each report overwrites the last, so the HTML in the coverage-<os> artefact shows only one framework. A TFM-specific gap (the kind #14 chases, or net481 on Windows) is then invisible to a reviewer. #19 fixed this overwrite for coverlet. #51 removed coverlet and, following upstream, deliberately didn't carry the fix.

The change

  • ADR 0004 amendment: divergence 5. Each TFM's report goes to artifacts/coverage-reports/<Project>/<tfm>/. The amendment replaces the ADR's "Why keep the shared HTML report directory?" reasoning and updates the divergence table, the task's output contract and the risk table.
  • cake.cs: targetDirectory now includes the TFM tag. That's one path segment, plus a comment at the divergence, so a later upstream change to the task still applies as a rebrand.
  • CONTRIBUTING.md: the report path.

build.yml doesn't change: the artefact already uploads all of artifacts/coverage-reports. Each TFM's job-summary section reads its own SummaryGithub.md.

#19's other fix, keeping reports when the coverage gate fails, is already carried by #51: reports are generated before __VerifyCoverageThresholds.

Test

GenerateCoverageReports_EachBuiltTfm_WritesItsOwnReportDirectory is a check script. It runs the tests and __GenerateCoverageReports in Release, then asserts two things for every test project:

  • every built TFM (from dotnet msbuild -getProperty:TargetFrameworks) has artifacts/coverage-reports/<Project>/<tfm>/index.html;

  • no shared <Project>/index.html remains.

  • RED (before the fix): 20 failures. 15 per-TFM reports were missing, and each of the 5 projects had a shared report.

  • GREEN: 15/15 per-TFM reports, none shared. The figures differ by TFM; for example, the Specs line rate is 0.69813 on net10.0, 0.69830 on net9.0 and 0.69821 on net8.0.

  • Full Default build (Release, macOS): all tasks succeed, with no threshold violations and no warnings.

Refs #14. Supersedes #19.

🤖 Generated with Claude Code

https://claude.ai/code/session_01U6RM4Rd2HejEcaWDY3qovL

iancooper and others added 2 commits October 18, 2026 19:23
…er TFM

Upstream's __GenerateCoverageReports writes every TFM of a project to one
directory, so the HTML shows only the last TFM processed. PR #19 fixed
this overwrite for coverlet; #51 dropped that fix with coverlet. The
amendment (approved by Ian, 2026-10-18) restores it on MTP as divergence
5: each TFM's report goes to artifacts/coverage-reports/<Project>/<tfm>/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U6RM4Rd2HejEcaWDY3qovL
__GenerateCoverageReports wrote every TFM of a project to
artifacts/coverage-reports/<Project>/, so each report overwrote the last
and the HTML showed only one framework. Each TFM now writes to
artifacts/coverage-reports/<Project>/<tfm>/. Carries PR #19's
per-framework report fix onto Microsoft Testing Platform.

- Test: GenerateCoverageReports_EachBuiltTfm_WritesItsOwnReportDirectory
  (RED 20 failures: no per-TFM report, a shared report per project;
  GREEN 15/15 per-TFM reports, none shared, figures differ per TFM)
- Implementation: targetDirectory takes the TFM tag; CONTRIBUTING.md path

Refs #14

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U6RM4Rd2HejEcaWDY3qovL
@iancooper
iancooper merged commit cf7c3cd into main Oct 19, 2026
23 checks passed
@iancooper
iancooper deleted the fix/19-per-tfm-coverage-reports branch October 19, 2026 23:20
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant