Skip to content

[quality] add unit tests for bd decompose CLI (src/cmd/bd/decompose.go, 0% -> 85%) - #4899

Merged
kubestellar-prow[bot] merged 1 commit into
v4from
quality/test-bd-decompose
Aug 27, 2026
Merged

[quality] add unit tests for bd decompose CLI (src/cmd/bd/decompose.go, 0% -> 85%)#4899
kubestellar-prow[bot] merged 1 commit into
v4from
quality/test-bd-decompose

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds src/cmd/bd/decompose_test.go — the only file this PR touches. src/cmd/bd/decompose.go (55 statements: cmdDecompose, readPlan, decomposePromptFor) had zero test coverage.

New tests cover:

  • readPlan: file source, stdin source, missing-file error
  • decomposePromptFor: thin-wrapper contract over planning.BuildPrompt
  • cmdDecompose: --print-prompt, --plan <file>, stdin plan, --auto-approve (plan_status draft→approved), and --actor override — asserting persisted child task beads through a re-opened store per the reloadStore convention in main_test.go

Coverage: decompose.go 0% → ~85%; cmd/bd package 69.3% → 75.8%. Verified with go test -count=1 -coverprofile ./cmd/bd/ — all tests pass.

Claimed ground: src/cmd/bd/decompose_test.go only. Disjoint from open PRs #4032 (proxy auth), #4895 (pkg/beads), #4892 (pkg/agent), #4891 (linear/scheduler).


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

— hive: agent=quality backend=copilot model=claude-fable-5 copilot=1.0.78

cmd/bd/decompose.go (55 stmts) had zero coverage: cmdDecompose,
readPlan, and decomposePromptFor were all untested. Adds
decompose_test.go covering:

- readPlan: file, stdin, and missing-file error paths
- decomposePromptFor: BuildPrompt passthrough
- cmdDecompose: --print-prompt, --plan file, stdin plan,
  --auto-approve plan_status transition, and --actor override,
  asserting persisted child task beads via a reloaded store
  (per the reloadStore convention in main_test.go)

Raises cmd/bd package coverage from 69.3% to 75.8%.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: sec-check <sec-check@hive.kubestellar.io>
@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 27, 2026
@kubestellar-hive kubestellar-hive Bot added quality testing agent/quality Approved by a Hive merger/owner for auto-merge on green CI hive/hosted-available-oke-11-placeholder-r05x Approved by a Hive merger/owner for auto-merge on green CI labels Aug 27, 2026
@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.

@clubanderson clubanderson removed the hold label Aug 27, 2026
@clubanderson

Copy link
Copy Markdown
Member

Reviewed: real behavioral coverage for the bd decompose CLI — persisted child beads asserted through a re-opened store, plan_status draft→approved under --auto-approve, stdin and --plan sources, actor override. Single disjoint test file, CI fully green.
/lgtm
/approve

@kubestellar-prow kubestellar-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 27, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: 1c9858a914db762a8d1eca7d86653a4ef72c96ba

@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: clubanderson

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

The pull request process is described 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

@kubestellar-prow kubestellar-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 27, 2026
@kubestellar-prow
kubestellar-prow Bot merged commit 014df63 into v4 Aug 27, 2026
40 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-bd-decompose branch August 27, 2026 16:39
@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

agent/quality Approved by a Hive merger/owner for auto-merge on green CI approved Indicates a PR has been approved by an approver from all required OWNERS files. copilot dco-signoff: yes Indicates the PR's author has signed the DCO. hive/hosted-available-oke-11-placeholder-r05x Approved by a Hive merger/owner for auto-merge on green CI lgtm Indicates that a PR is ready to be merged. quality size/L Denotes a PR that changes 100-499 lines, ignoring generated files. testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant