test: add TDD bug-capture test for #968 — plan explain plan_id handling #1052

Merged
hurui200320 merged 1 commits from tdd/m3-plan-explain-plan-id into master 2026-03-19 07:21:12 +00:00

1 Commits

Author SHA1 Message Date
hurui200320 058d486593 test: add TDD bug-capture test for #968 — plan explain plan_id handling
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 17s
CI / quality (pull_request) Successful in 41s
CI / typecheck (pull_request) Successful in 46s
CI / security (pull_request) Successful in 53s
CI / unit_tests (pull_request) Successful in 3m24s
CI / integration_tests (pull_request) Successful in 3m50s
CI / docker (pull_request) Successful in 58s
CI / e2e_tests (pull_request) Successful in 5m12s
CI / coverage (pull_request) Successful in 6m55s
CI / benchmark-regression (pull_request) Successful in 38m8s
Add TDD bug-capture tests for bug #968, which reports that the
`plan explain` CLI command fails with rc=1 when given a plan_id
because `explain_decision_cmd` treats its argument as a decision_id
and `svc.get_decision(plan_id)` returns None.

Behave tests (features/tdd_plan_explain_plan_id.feature):
- Two scenarios tagged @tdd_expected_fail @tdd_bug @tdd_bug_968
- Mock DecisionService with get_decision returning None for plan_id
  and list_decisions returning decisions for the plan
- Assert plan explain <plan_id> succeeds (rc=0) with decision details
- Assertions intentionally fail (proving the bug exists); tag inversion
  makes CI pass

Robot tests (robot/tdd_plan_explain_plan_id.robot):
- Two integration test cases with tdd_expected_fail tags
- Helper script records decisions via DecisionService, invokes CLI
  `plan explain <plan_id>`, and asserts rc=0 with decision output

The tests will run normally (without @tdd_expected_fail) once bug #968
is fixed, serving as permanent regression tests.

ISSUES CLOSED: #978
2026-03-19 15:13:16 +08:00