test(onboard): correct caller-level coverage citation in gateway-start-failure-integration tests#5118
Conversation
…narrow follow-up scope Address PR Review Advisor's worth-checking finding 'Coverage-gap notes understate existing caller-level regression coverage'. The advisor correctly pointed out that test/onboard.test.ts already contains a process-level regression test for #2347: it("fast-fails gateway start before health polling when Docker is unreachable (#2347)", ...) That test spawns a child Node process with a PATH-shimmed openshell, mocks p-retry, loads the compiled startGateway from dist/lib/onboard.js, and asserts exit 1, "Docker daemon is not running", "colima start", absence of "Waiting for gateway health", and absence of HEALTH POLL REACHED (i.e. no status/gateway-info probes). It supersedes two of the three it.todo placeholders this PR previously documented as caller-level gaps. Updates: - File header in gateway-start-failure-integration.test.ts now cites test/onboard.test.ts as the primary caller-level coverage source and explains exactly which contract remains un-asserted. - The 'call-site contracts (caller-level coverage gap)' describe block is renamed to 'call-site contracts (narrow remaining gap)' and shrinks from three it.todo entries to one. Items 1 and 2 (no health-poll loop entry, no status/gateway-info probes) are removed because they are already proven by test/onboard.test.ts. Item 3 is rewritten to focus on the actual remaining gap: distinguishing dockerUnreachable=true from other exit-1 paths via the absence of the 'Cleaning up failed gateway state...' line that the alternative branch prints. - Inventory entry's notes updated similarly: cites test/onboard.test.ts as existing caller-level coverage and narrows the residual gap. Issue #5113 should be re-scoped down (or potentially closed) given the much smaller remaining gap; that update is a separate action. Verified locally: 18 passing tests + 1 todo (was 18 + 3); biome clean. Refs: #2347, #4355, #5113
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTest documentation in ChangesTest coverage documentation clarification
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
E2E Advisor RecommendationRequired E2E: None Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
|
E2E Scenario Advisor RecommendationRequired scenario E2E: None Full scenario advisor summaryE2E Scenario AdvisorBase: Required scenario E2E
Optional scenario E2E
Relevant changed files
|
PR Review AdvisorFindings: 1 needs attention, 1 worth checking, 0 nice ideas Review findings🛠️ Needs attention
🔎 Worth checking
🌱 Nice ideas
Consider writing more tests for
This is an automated advisory review. A human maintainer must make the final merge decision. |
|
Superseded by #5119 (merged 2026-06-10T08:07:23Z), which fully retired In particular, #5119:
There's no remaining content in this PR worth landing. Closing. |
Summary
Small accuracy fix for documentation that landed in PR #5109. The merged PR's
it.todoblock insrc/lib/onboard/gateway-start-failure-integration.test.tsand the inventory entry'snotesfield both overstate a coverage gap: they describe three caller-level contracts as "not directly proven", but two of those contracts are already proven by an existing process-level test intest/onboard.test.ts.This PR was authored as
f532050b6on the #5109 branch but lost a race against the merge —cvapproved at 06:36:51Z, the squash-merge happened at 06:38:23Z, the accuracy fix was pushed shortly after and never landed.What's actually proven (and where)
The post-merge state in
mainclaims the following are unproven caller-level gaps:startGatewayaborts viapRetry.AbortErrorwithout entering health-poll loopstartGatewaynever invokes openshellstatusorgateway infoafter docker-unreachable outputstartGatewayforwardsdockerUnreachable=truetohandleFinalGatewayStartFailuretest/onboard.test.ts:357(it("fast-fails gateway start before health polling when Docker is unreachable (#2347)", ...)) already proves items 1 and 2 by spawning a child Node process with a PATH-shimmed openshell, mockingp-retry, loading the compiledstartGateway()fromdist/lib/onboard.js, and asserting:"Docker daemon is not running"in stderr"colima start"macOS hint"Waiting for gateway health"(proves item 1)HEALTH POLL REACHED(proves item 2)What that test does not assert is the absence of the
"Cleaning up failed gateway state..."line that the non-dockerUnreachablebranch prints. That absence is the only signal that distinguishesdockerUnreachable=trueforwarding (item 3) from other exit-1 paths instartGatewayWithOptions. Item 3 alone is the genuine remaining gap.What this PR does
Two files, comment-only changes:
src/lib/onboard/gateway-start-failure-integration.test.tstest/onboard.test.tsas the primary caller-level coverage, with the assertion list copied for reviewers. Theit.tododescribe block is renamed(narrow remaining gap)and shrinks from 3 entries to 1, focused on the cleanup-messaging-absence signal.test/e2e-scenario/migration/legacy-inventory.jsonnotesfield updated to citetest/onboard.test.tsand narrow the residual gap.No production code changes; no test logic changes; only documentation and one
it.todoconsolidation.Knock-on effect: re-scope #5113
Issue #5113 (
Extract attemptGatewayStart helper from startGatewayWithOptions for caller-level testability) was filed when I thought the gap was 3 contracts. With items 1–2 already covered, the issue's scope can shrink to either:test/onboard.test.ts:357test asserting!result.stderr.includes("Cleaning up failed gateway state"), orI'll add a comment on #5113 with this update.
Refs
test/onboard.test.ts:357(the existing process-level test)Summary by CodeRabbit
Tests
Chores
Note: This release contains no user-facing changes; updates are internal to testing and documentation.