test(miner-governor): close codecov/patch gap on kill-switch's repoFullName fallback - #5047
Conversation
…llName fallback PR #5012 (#2341, merged) landed with codecov/patch failing at 92.30% -- one partial branch never exercised: the root vitest test only ever supplied repoFullName on transitions, so buildMinerKillSwitchTransitionGovernorLedgerEvent's `input.repoFullName ?? null` fallback (kill-switch.ts:69) never took its null-producing side. Add a real, non-no-op transition (a genuine scope change) with repoFullName omitted, asserting the ledger row's repoFullName lands as null rather than undefined or omitted. kill-switch.ts now measures 100/100/100/100 via the same root vitest + vi.mock source-redirect path codecov actually reads (the engine package's own separate node:test suite, which this session had been using for local verification elsewhere, is invisible to codecov -- only files with a corresponding miner-lib wrapper exercised by a root vitest test are.)
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5047 +/- ##
=======================================
Coverage 94.16% 94.16%
=======================================
Files 463 463
Lines 39429 39429
Branches 14384 14384
=======================================
+ Hits 37128 37129 +1
Misses 1646 1646
+ Partials 655 654 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-11 10:43:44 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 1 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
Follow-up to #2341 (#5012, merged). That PR landed with
codecov/patchactually failing at 92.30% -- I only discovered this by checking the raw PR checks after the fact, since my own verification during that PR relied on the engine package's separatenode:testsuite, which is invisible to Codecov. Only files with a correspondingpackages/gittensory-miner/lib/wrapper exercised by a root-level vitest test (via thevi.mock("@jsonbored/gittensory-engine", ...)source-redirect pattern) are actually measured by Codecov --kill-switch.tshas exactly that (governor-kill-switch.js+test/unit/miner-governor-kill-switch.test.ts), so the gap was real and reachable, not a scope-exclusion artifact.The one partial branch:
buildMinerKillSwitchTransitionGovernorLedgerEvent'sinput.repoFullName ?? null(kill-switch.ts:69) never took its null-producing side -- the root test's only transition-recording assertions always supplied arepoFullName, and the one test that omitted it never reached that line (it was a same-scope no-op, returningnullearlier). Added a genuine scope-changing transition withrepoFullNameomitted, asserting the ledger row lands withrepoFullName: null.Validation
kill-switch.ts: 100.00% stmts / 100.00% branch / 100.00% funcs / 100.00% lines (was 92.85% branch / 92.30% Codecov patch).Test-only change, no production code touched.
Test plan