Skip to content

test(#386): raise TestKit/ErrorPolicies coverage to >=99% (unblocks the release) - #422

Merged
Chris-Wolfgang merged 1 commit into
vNextfrom
chore/386-raise-testkit-errorpolicies-coverage
Aug 18, 2026
Merged

Chris-Wolfgang merged 1 commit into
vNextfrom
chore/386-raise-testkit-errorpolicies-coverage

Conversation

@Chris-Wolfgang

@Chris-Wolfgang Chris-Wolfgang commented Aug 18, 2026 •

Copy link
Copy Markdown
Owner

Unblocks the 0.23.2 release PR (#421), which the #418 >=99% coverage gate correctly failed (CI put ErrorPolicies.Tests.Unit and TestKit.Tests.Unit at 98.7%).

Fixes — exclude ONLY genuinely-never-executed code

  1. SDK entry point. coverlet.runsettings's ExcludeByFile glob never matched the AutoGeneratedProgram (Microsoft.NET.Test.Sdk.Program.cs) at its Windows NuGet-cache path. Excluded by type name (<Exclude>[*]AutoGeneratedProgram</Exclude>) — ErrorPolicies.Tests.Unit → 100%.
  2. Mutation survivors (112) — kill these to raise the score #346 mutation-test helpers — member-level [ExcludeFromCodeCoverage] on code that never runs:
    • test-double IProgressTimer empty Start/Dispose stubs (StopTimer, which IS asserted, stays measured);
    • explicit IEnumerator/IEnumerable impls never reached via the non-generic interface (the generic GetEnumerator/MoveNext/Current the tests drive stay measured);
    • empty-source async iterators passed to pre-cancelled ops that throw before enumerating them.
    • Partially-executed helpers stay measured — cancel-mid sources' unreachable trailing yields honestly remain uncovered.

Nothing that executes was excluded, and no whole classes were excluded.

Result (net10.0)

assembly before after
ErrorPolicies.Tests.Unit 98.7% 100%
TestKit.Tests.Unit 98.7% 99.7%

Both clear the >=99% gate. Merge to vNext -> #421 re-runs Stage-1 and passes.

🤖 Generated with Claude Code

Copilot AI lite review requested due to automatic review settings August 18, 2026 13:26

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 was unable to review this pull request because the user who requested the review has reached their quota limit.

The >=99% coverage gate (#418) correctly failed the release: CI's merged report
put ErrorPolicies.Tests.Unit and TestKit.Tests.Unit at 98.7%. Two causes:

1. The SDK entry point (AutoGeneratedProgram / Microsoft.NET.Test.Sdk.Program.cs)
   was never actually excluded — coverlet's ExcludeByFile glob doesn't match its
   absolute Windows NuGet-cache path. Exclude it by type name
   (`<Exclude>[*]AutoGeneratedProgram</Exclude>`). Takes ErrorPolicies.Tests.Unit
   to 100% and drops the 1-line SDK gap from every test assembly.

2. The #346 mutation-test helpers. Excluded ONLY genuinely-never-executed code,
   at the MEMBER level (not whole classes), so code that IS tested stays measured:
   - IProgressTimer stub doubles' empty Start(int){}/Dispose(){} (never called) —
     their StopTimer(), which IS asserted on, stays measured.
   - explicit IEnumerator/IEnumerable impls (IEnumerable.GetEnumerator, IEnumerator.
     Current, Reset) never reached through the non-generic interface — the generic
     GetEnumerator/MoveNext/Current that the tests DO drive stay measured.
   - empty-source async iterators passed to pre-cancelled operations that throw
     before enumerating them, so the body never runs.
   Partially-executed helpers (cancel-mid sources) are left measured; their
   unreachable trailing yields honestly remain uncovered.

Result (net10.0): ErrorPolicies.Tests.Unit 100%, TestKit.Tests.Unit 99.7% — both
clear the >=99% gate with only never-executed code excluded.

Co-Authored-By: Claude Opus 4.8 <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.

2 participants