[quality] test: cover rescanRepos success/fail-closed/work-source overlay arms (cmd/hive/repos_rescan.go) - #6188
Conversation
…ce overlay arms (cmd/hive/repos_rescan.go) rescanRepos was at 7.4% statement coverage — only the nil-client arm was tested. Add cmd/hive/repos_rescan_paths_test.go covering: - success path: enumeration published to lastActionable, refresh invoked - nil refresh hook tolerated - all-repos GitHub failure on the default work source fails closed: error returned, prior snapshot kept, no repaint - GitHub outage on a non-GitHub work source keeps the scan alive with a substitute result and the overlay's fail-closed (zero issues) arm - overlay replaces the issue side while keeping GitHub PRs for maintenance rescanRepos: 7.4% -> 100%. Fixtures use github.NewClientForTest against a local httptest server; no network, no /data writes required. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: hivecommons-hive[bot] <hive-bot@hivecommons.dev>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Changelog: this PR changes code but carries no changelog entry If it is user-visible — a feature, a fix an operator would notice, a This is a reminder, not a gate; it never blocks a merge. |
Test Improvement
rescanRepos(cmd/hive/repos_rescan.go) — the read-only half of the eval cycle behind the dashboard Rescan button — was at 7.4% statement coverage: only the nil-client (errNoForgeCredentials) arm was tested.This PR adds
src/cmd/hive/repos_rescan_paths_test.gocovering the remaining arms:lastActionablepointer, dashboardrefreshinvokedactionableAfterGitHubEnumerate, with the overlay's fail-closed (config error → zero issues) arm exercised and log assertionsrescanRepos: 7.4% → 100%. Fixtures usegithub.NewClientForTestagainst a localhttptestserver (same pattern asautomerge_sweep_wiring_test.go); no network, no /data writes.Claimed ground
Files:
src/cmd/hive/repos_rescan_paths_test.go(new, test-only). Functions under test:rescanRepos. Disjoint from open quality PRs #6120 (dashboard rescan route auth test), #6136/#6159/#6127 (other cmd/hive helpers), and all other open hold-gated PRs.Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5