Files
cleveragents-core/features/tdd_plan_explain_plan_id.feature
HAL9000 4d04b2e4ad
CI / lint (pull_request) Successful in 48s
CI / quality (pull_request) Successful in 47s
CI / typecheck (pull_request) Successful in 1m8s
CI / build (pull_request) Successful in 30s
CI / push-validation (pull_request) Successful in 19s
CI / security (pull_request) Successful in 1m22s
CI / helm (pull_request) Successful in 28s
CI / unit_tests (pull_request) Successful in 5m58s
CI / docker (pull_request) Successful in 1m38s
CI / coverage (pull_request) Successful in 13m36s
CI / integration_tests (pull_request) Successful in 22m10s
CI / status-check (pull_request) Successful in 3s
test(tdd): restore tdd_plan_explain_plan_id regression tests for fixed behaviour
The TDD regression files for bug #968 were incorrectly deleted instead of
updated to assert the spec-compliant fixed behaviour from issue #6325.
Per CONTRIBUTING.md the regression guard must be kept and updated — not
removed — once the bug is fixed.

Restore and update all three files to assert the new expected behaviour:
- plan explain rejects a non-decision-id argument with rc=1
- error output contains "not found"
- decision data fields are absent from output

Also pair the orphaned robot/helper_tdd_plan_explain_plan_id.py with a
restored robot test file and update it to verify rc=1 rejection behaviour.

ISSUES CLOSED: #6325
2026-05-31 15:00:33 -04:00

24 lines
1.3 KiB
Gherkin

@tdd_issue @tdd_issue_968 @mock_only
Feature: TDD Issue #968 — plan explain rejects plan_id, accepts only decision_id
As a developer
I want to verify that `plan explain <plan_id>` is rejected with rc=1
So that the spec-compliant fix from issue #6325 is protected by a regression test
# Originally written to capture bug #968: plan explain silently fell back to
# treating the argument as a plan_id via list_decisions. Issue #6325 fixed
# this by removing the fallback and enforcing strict decision-only lookup.
# These scenarios assert the fixed behaviour: rc=1 with a clear error message
# when a non-decision identifier is passed to `plan explain`.
Scenario: Plan explain rejects a plan_id with return code 1
Given tdd968 a mock DecisionService where get_decision raises DecisionNotFoundError for a plan id
When tdd968 I invoke plan explain with the plan id
Then tdd968 the command should exit with return code 1
And tdd968 the output should contain "not found"
Scenario: Plan explain with plan_id does not output decision data
Given tdd968 a mock DecisionService where get_decision raises DecisionNotFoundError for a plan id
When tdd968 I invoke plan explain with the plan id
Then tdd968 the command should exit with return code 1
And tdd968 the output should not contain "decision_id"