Skip to content

πŸ§ͺ test(cmd/hive-backup): cover cmdList β€” exit codes and archive listing - #4946

Merged
clubanderson merged 1 commit into
v4from
quality/test-hive-backup-cmdlist
Aug 28, 2026
Merged

πŸ§ͺ test(cmd/hive-backup): cover cmdList β€” exit codes and archive listing#4946
clubanderson merged 1 commit into
v4from
quality/test-hive-backup-cmdlist

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds src/cmd/hive-backup/list_test.go covering cmdList in src/cmd/hive-backup/main.go β€” the only hive-backup command with 0% coverage. This is the disaster-recovery listing path an operator runs during an incident.

Four tests via the existing runMainHelper re-exec harness and the HIVE_BACKUP_OCI_ENDPOINT test seam:

  • missing OCI credentials β†’ exit 1 with list failed (fail closed, never an empty listing)
  • upstream bucket-listing HTTP 500 β†’ exit 1
  • happy path β†’ exit 0, prints only hive-hub-backup-* objects, newest first
  • empty bucket β†’ exit 0, no output

Package coverage: 78.2% β†’ 86.4%; cmdList 0% β†’ 80% (remaining lines are the success-path print loop, asserted via output but not flushed by the child coverage runtime).

Occupied-ground check

Disjoint from all open hold-gated PRs: #4905 (cmd/hive), #4923 (cmd/bd), #4931 (dashboard readouts), #4939 (linearagent), #4032 (proxy), #4942 (Dockerfiles). Touches only the new test file.


Filed by quality agent (hold-gated mode). Human review required.

β€” hive: agent=quality backend=copilot model=claude-fable-5

… output

cmdList was the only hive-backup command with zero coverage (0%). Add four
re-exec tests using the existing runMainHelper harness and the
HIVE_BACKUP_OCI_ENDPOINT test seam:

- missing OCI credentials exit nonzero with 'list failed'
- upstream bucket-listing failure exits nonzero
- happy path prints only hive-hub-backup-* objects, newest first, exit 0
- empty bucket exits zero with no output

cmd/hive-backup package coverage: 78.2% -> 86.4%.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: hive-quality <quality@hive.local>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Aug 28, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions

Copy link
Copy Markdown
Contributor

Changelog: this PR changes code but does not touch CHANGELOG.md.

If it is user-visible β€” a feature, a fix an operator would notice, a
security change, a migration, a deprecation, or anything breaking β€”
please add a line under ## Unreleased. If it is a refactor, a
test-only change, or dependency churn, no entry is needed and you can
ignore this.

This is a reminder, not a gate; it never blocks a merge.

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 28, 2026
@clubanderson
clubanderson merged commit 08dbeee into v4 Aug 28, 2026
42 of 43 checks passed
@clubanderson
clubanderson deleted the quality/test-hive-backup-cmdlist branch August 28, 2026 13:01
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot dco-signoff: yes Indicates the PR's author has signed the DCO. hold size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant