Skip to content

Report coverage in CI, and count only what a test can reach - #75

Merged
JaspervdM80 merged 3 commits into
mainfrom
claude/code-coverage-ci-pipeline-kfe190
Aug 11, 2026
Merged

Report coverage in CI, and count only what a test can reach#75
JaspervdM80 merged 3 commits into
mainfrom
claude/code-coverage-ci-pipeline-kfe190

Conversation

@JaspervdM80

Copy link
Copy Markdown
Owner

The coverage script has existed since it was written, but nothing ran it, so
the number never reached a pull request. The gate's own test run now carries
the collector — one test run, not a second one for the number — and an
advisory Coverage job judges the lines the change touched and writes the
verdict, the project totals and a per-file table to the run's summary page.

coverage.runsettings is what the collector is allowed to count, and both CI
and scripts/coverage.sh pass it, so a local number and a pipeline number mean
the same thing. Out of it: UI and Web by module and .razor / .razor.cs by
file, since a component's lines are only reachable by rendering it and
tests/ui and visual-check.sh are what do that; the scaffolded migrations and
the model snapshot, which were the bulk of what was being counted; and
DesignTimeDbContextFactory, which exists for dotnet ef. Core reads 95.1%
over 2,152 lines instead of 96.4% over 9,960 — the same suite, measured
against code somebody wrote.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01Szkd8DVfKLiQQXEPuC3wYx

claude added 3 commits August 11, 2026 14:38
The coverage script has existed since it was written, but nothing ran it, so
the number never reached a pull request. The gate's own test run now carries
the collector — one test run, not a second one for the number — and an
advisory Coverage job judges the lines the change touched and writes the
verdict, the project totals and a per-file table to the run's summary page.

coverage.runsettings is what the collector is allowed to count, and both CI
and scripts/coverage.sh pass it, so a local number and a pipeline number mean
the same thing. Out of it: UI and Web by module and .razor / .razor.cs by
file, since a component's lines are only reachable by rendering it and
tests/ui and visual-check.sh are what do that; the scaffolded migrations and
the model snapshot, which were the bulk of what was being counted; and
DesignTimeDbContextFactory, which exists for `dotnet ef`. Core reads 95.1%
over 2,152 lines instead of 96.4% over 9,960 — the same suite, measured
against code somebody wrote.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Szkd8DVfKLiQQXEPuC3wYx
The runsettings excluded CompilerGeneratedAttribute alongside coverlet's
actual defaults, on the assumption it only strips lambdas and iterator state
machines. It also marks every async method body and every auto-property, so
it was taking ServiceOperation.RunAdminAsync — the write guard every service
call goes through — and most of DatabaseSafety out of the report along with
the scaffolding it was meant to exclude. Core now reads 93.3% over 2,509
lines rather than the 95.1% over 2,152 a prior pass reported; the difference
is real hand-written code the collector was silently dropping.

coverage.mjs had the same shape of bug: a changed Core file the report
doesn't mention at all — because runsettings excluded it by attribute, not
because coverage.mjs's own EXCLUDED list knew its name — fell through to the
same silent `continue` as a diff hunk that only touched a blank line. It's
now named under the table as excluded, same as a migration.

Also make a malformed or unexpected Cobertura header fail loudly rather than
read as a trivial 100% branch coverage from pct(0, 0).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Szkd8DVfKLiQQXEPuC3wYx
@JaspervdM80
JaspervdM80 merged commit 32fe90a into main Aug 11, 2026
4 checks passed
@JaspervdM80
JaspervdM80 deleted the claude/code-coverage-ci-pipeline-kfe190 branch August 11, 2026 15:43
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.

2 participants