[quality] add unit tests for bd decompose CLI (src/cmd/bd/decompose.go, 0% -> 85%) - #4899
Conversation
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>
|
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. |
|
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 label has been added. DetailsGit tree hash: 1c9858a914db762a8d1eca7d86653a4ef72c96ba |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
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
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 errordecomposePromptFor: thin-wrapper contract overplanning.BuildPromptcmdDecompose:--print-prompt,--plan <file>, stdin plan,--auto-approve(plan_status draft→approved), and--actoroverride — asserting persisted child task beads through a re-opened store per thereloadStoreconvention inmain_test.goCoverage:
decompose.go0% → ~85%;cmd/bdpackage 69.3% → 75.8%. Verified withgo test -count=1 -coverprofile ./cmd/bd/— all tests pass.Claimed ground:
src/cmd/bd/decompose_test.goonly. 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