Skip to content

ci(coverage): gate test assemblies at 100% and stop gating class rows - #379

Merged
Chris-Wolfgang merged 2 commits into
mainfrom
ci/test-assembly-coverage-gate
Sep 27, 2026
Merged

Chris-Wolfgang merged 2 commits into
mainfrom
ci/test-assembly-coverage-gate

Conversation

@Chris-Wolfgang

Copy link
Copy Markdown
Owner

Summary

This is #310 steps 4 and 5, ported from repo-template. pr.yaml here is far behind the template in other ways (trigger, guard, gitleaks), so only the coverage-gate steps change; this is not a full template upgrade.

pr.yaml: all three Enforce 90% coverage threshold steps (Linux bash, Windows pwsh, macOS bash) are replaced with the template's:

  • Stage 1 parse bug: it read Summary.txt with a bare while read -r, which strips leading whitespace, so the ^[^ ] filter matched ReportGenerator's indented class rows and gated each class as if it were an assembly. It now uses IFS= read -r.
  • Test-assembly threshold: assemblies built from projects under tests/ are held to the new CODECOV_TEST_MINIMUM: 100, and src/ stays at CODECOV_MINIMUM: 90. Test assemblies are identified by project location, never by name. A failing test assembly lists its classes below 100%.

release.yaml (step 5):

  • It gets the same threshold split in Verify coverage threshold. I kept this repo's dotnet tool install -g dotnet-reportgenerator-globaltool, because the repo has no tool manifest.
  • The coverage-collecting dotnet test calls now pass --settings coverlet.runsettings. Without it, release never instrumented the test assemblies, so the 100% rule had nothing to gate. The template has the same gap.

Verification

  • Local Stage 1 simulation: Tests.Unit on net5.0–net10.0 plus Tests.Concurrency (test: add a concurrency stress suite #376), with --settings coverlet.runsettings, merged by ReportGenerator: Wolfgang.TryPattern 100%, Tests.Unit 100%, Tests.Concurrency 100%.
  • The new Stage 1 gate script, extracted from this pr.yaml and run under Git Bash:
    • on that summary, passes, with src gated at 90 and both test assemblies at 100;
    • with Tests.Unit edited to 97.7%, fails with exit 1 and prints Classes below 100%: 97.7% …PropertyTests.
  • Stages 2 and 3 and release.yaml are the template's code unchanged apart from the ReportGenerator install line. I haven't executed them locally; CI runs Stages 2 and 3.

Merge notes

Refs #310

🤖 Generated with Claude Code

Chris-Wolfgang and others added 2 commits September 26, 2026 19:25
…#310)

pr.yaml: the three "Enforce 90% coverage threshold" steps are now
repo-template's. Stage 1 reads Summary.txt with `IFS= read -r`; a bare
`read -r` stripped the indentation the `^[^ ]` filter relies on, so
per-class rows were gated as if they were assemblies. Assemblies built
from projects under tests/ (identified by location, not name) are held
to CODECOV_TEST_MINIMUM=100; src stays at CODECOV_MINIMUM=90. A failing
test assembly lists its classes below 100%.

release.yaml: same threshold split in its gate, and the coverage-
collecting `dotnet test` calls pass --settings coverlet.runsettings, so
release instruments the test assemblies exactly as PR CI does. Without
that, the release gate saw no test rows and the 100% rule was inert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Chris-Wolfgang
Chris-Wolfgang merged commit 06a42d6 into main Sep 27, 2026
18 checks passed
@Chris-Wolfgang
Chris-Wolfgang deleted the ci/test-assembly-coverage-gate branch September 27, 2026 01:31
Chris-Wolfgang added a commit that referenced this pull request Sep 27, 2026
…istically (#383)

RunAsync_Action_CancellationToken_when_cancellation_is_requested_after_
action_started signalled "started" before the loop, so a fast runner could
cancel before the first `Task.Delay(10).Wait()`, leaving that line
uncovered on some runs. With the 100% test-assembly gate (#379) that made
Stage 3 (macOS ARM64) fail at 97.9% on PR #381's run 36285791752 while
Linux and Windows passed. The action now signals after a full pass of the
loop body, so every line executes before the test cancels.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant