test(#386): raise TestKit/ErrorPolicies coverage to >=99% (unblocks the release) - #422
Merged
Chris-Wolfgang merged 1 commit intoAug 18, 2026
Conversation
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>
Chris-Wolfgang
force-pushed
the
chore/386-raise-testkit-errorpolicies-coverage
branch
from
August 18, 2026 15:20
c3bb070 to
5bca0de
Compare
Chris-Wolfgang
deleted the
chore/386-raise-testkit-errorpolicies-coverage
branch
August 18, 2026 16:46
This was referenced Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unblocks the 0.23.2 release PR (#421), which the #418 >=99% coverage gate correctly failed (CI put
ErrorPolicies.Tests.UnitandTestKit.Tests.Unitat 98.7%).Fixes — exclude ONLY genuinely-never-executed code
coverlet.runsettings'sExcludeByFileglob never matched theAutoGeneratedProgram(Microsoft.NET.Test.Sdk.Program.cs) at its Windows NuGet-cache path. Excluded by type name (<Exclude>[*]AutoGeneratedProgram</Exclude>) — ErrorPolicies.Tests.Unit → 100%.[ExcludeFromCodeCoverage]on code that never runs:IProgressTimeremptyStart/Disposestubs (StopTimer, which IS asserted, stays measured);IEnumerator/IEnumerableimpls never reached via the non-generic interface (the genericGetEnumerator/MoveNext/Currentthe tests drive stay measured);yields honestly remain uncovered.Nothing that executes was excluded, and no whole classes were excluded.
Result (net10.0)
Both clear the >=99% gate. Merge to vNext -> #421 re-runs Stage-1 and passes.
🤖 Generated with Claude Code