[quality] 🧪 test(tui): cover zero-covered attach error types, KickResult.Queued, bare stub.View - #5459
Conversation
…kResult.Queued, and bare stub.View Per-function coverage showed four 0%% seams in pkg/tui that no open PR claims: - attach.go: tmuxNotFoundError.Error/Unwrap and tmuxSessionMissingError.Unwrap — the typed-error contract the attach preflight footer and errors.Is chains depend on. New attach_errors_test.go pins the exact messages (with/without tmux detail) and that both Unwrap methods expose the underlying cause. - client/actions.go: KickResult.Queued — the #5325 async-kick seam distinguishing 'queued' from 'in-flight'. New kick_result_test.go pins both wire values, the empty case, and case-sensitivity. - panes/pane.go: stub.View — every shipped pane overrides View, so the shared fallback is reachable only through the next pane that embeds stub; stub_view_test.go pins it directly (box fill + degenerate size). app.Run stays uncovered: it wraps tea.NewProgram().Run() on the live terminal and needs a seam, not a test-only workaround. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: hive-quality <quality@hive.local>
|
[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 does not touch 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. |
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
Test Improvement
Per-function coverage (
go tool cover -func, main @ 92c4b6e, pkg-wide 92.9%) shows only ten 0% functions; four are inpkg/tuiand none is claimed by any open PR. This PR covers three of them with tests only — no production changes:Files/functions claimed (exact):
src/pkg/tui/attach_errors_test.go(new) →src/pkg/tui/attach.go:tmuxNotFoundError.Error/Unwrap,tmuxSessionMissingError.Unwrap— pins the exact footer messages (with/without tmux detail) and thaterrors.Is/errors.Aschains reach the underlying cause.src/pkg/tui/client/kick_result_test.go(new) →src/pkg/tui/client/actions.go:KickResult.Queued— the 🐛 Kick reports 504 while succeeding: the handler blocks up to 120s waiting for the CLI prompt #5325 async-kick seam; pinsqueuedvsin-flight, empty, and case-sensitivity against the wire constant.src/pkg/tui/panes/stub_view_test.go(new) →src/pkg/tui/panes/pane.go:stub.View— every shipped pane overrides View, so the shared fallback is only reachable by the next pane embeddingstub; pinned directly (box fill + degenerate-size guard).Left uncovered deliberately:
app.Run(wrapstea.NewProgram().Run()on a live terminal; needs a production seam, out of quality scope).Validation:
go test -count=1 -short ./pkg/tui/...— all four packages ok.Preflight vs open hold-gated PRs: disjoint from #5440 (pkg/agent), #5433 (pkg/config checkout_root + dashboard terminal_urls), #5428 (pkg/config entrypoint_boot), #5436 (systemd), #4032 (pkg/proxy//pkg/github auth inject). No shared files or functions.
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5