1.12 Coverage gate + flaky-test stabilization (§2.3) #27
Labels
No labels
epic
phase-0
phase-1
phase-2
phase-3
phase-4
phase-5
phase-6
phase-7
phase-8
phase-9
priority/P0
priority/P1
priority/P2
type/backend
type/client
type/docs
type/ops
type/security
type/spike
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/failsulit#27
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Wire coverlet + ≥ 80% line-coverage gate into CI/pre-push; triage flaky backend tests.
Evidence at resume (2026-11-03): 26–29 failures varying between runs (677 total), SQLite 'FOREIGN KEY constraint failed' during seed/teardown (seed-ordering/cleanup races); pre-push hook tolerates them under a threshold; Debug-config 'dotnet test' broken on this machine (testhost 18.6.0 deps-manifest error — use 'dotnet run --project tests/SsdidDrive.Api.Tests/ -c Release' like the hook does). Baseline was 629/629 green in March.
Exit: coverage gate enforced ≥ 80% on API project; backend suite passes with ZERO tolerated failures for 3 consecutive runs.
Part of epic #2. Source: §5 (1.12) + §2.3
ROOT CAUSE FOUND by baseline review (#B-1, 08-code-baseline-review.md): the flakiness is NOT test infrastructure — fixtures are clean. Commit
997f657(Mar 24) wired SsdidAuditSink.cs:36 to write audit rows with ActorId=Guid.Empty (FK violation vs users.id) fire-and-forget into the request-scoped DbContext → poisons handlers' awaited SaveChanges → intermittent 500s on wallet register/login paths. Today's run log: 371 audit_log FK failures + 51 provisioning 500s; March logs (pre-997f657) have none. Fix lands in #B-1; this task then verifies 3 consecutive zero-failure runs and wires the ≥80% coverage gate. Also: Debugdotnet testis broken because the project uses xunit.v3 MTP runner with no VSTest infra — usedotnet run -c Release(hook's invocation) until #B-1 follow-up adds UseMicrosoftTestingPlatformRunner.Progress update (2026-11-04, commit
d44329b) — coverage gate is LIVE, issue stays open until the 80% floor:scripts/coverage-gate.sh: suite under coverlet, enforces zero tolerated failures AND a line-coverage floor on FailSulit.Api. Excludes EF migrations (35k generated designer/snapshot lines), top-level Program, and compiler-generated OpenApi helpers. Measured baseline: 74.7% Debug / 75.7% Release (700 tests).api-ci.yml(push/PR triggers re-enabled, coverage step added).Plan: close the four gaps test-by-test, ratcheting
COVERAGE_MINwith each landed batch until the floor reaches 80, then close this issue.Ratchet update (2026-11-04, PR #46 merged): floor raised 73 -> 78. Measured 78.7% Debug / 79.6% Release on 726 tests (was 74.7/75.7 on 700).
Closed gaps: GetRootFolderContents (5 tests), EmailRegisterVerify (9), HmacAuthMiddleware (12). Coverage work surfaced a real production bug — fixed via #44 (no-tracking user mutation broke personal-tenant persistence).
Remaining gap to the 80% exit: OIDC verify/callback (~280 lines, needs a fake-IdP harness) — that harness is the next chunk of work. Zero-tolerance + ratchet both enforced by the pre-push hook and (once the runner is healthy) api-ci.
CLOSED — 80% exit gate satisfied. PR #48 (squash
a2b2f0d): FakeIdpServer harness (in-process OIDC provider on HttpListener) + 19 flow tests covering authorize/callback/verify/link end-to-end over real HTTP. Prod seam: provider endpoints config-overridable; validator honors explicitly-configured http:// metadata and fails closed as 401 (garbage tokens previously leaked 500s).Coverage: 82.51% Release / 81.77% Debug (746 tests, zero failures); floor raised 78 → 80. Suite green ×3 + pre-push hook green (build + tests + coverage gate). Flaky stabilization complete: hook is zero-tolerance and green.