test(plan-correct): add failing BDD scenario proving JSON output missing spec envelope #8662

Merged
HAL9000 merged 4 commits from test/plan-correct-json-output-tdd into master 2026-06-02 11:34:47 +00:00

4 Commits

Author SHA1 Message Date
HAL9000 bf6326b715 test(plan-correct): remove @tdd_expected_fail now bug #8584 is fixed
CI / push-validation (pull_request) Successful in 23s
CI / lint (pull_request) Successful in 36s
CI / build (pull_request) Successful in 41s
CI / helm (pull_request) Successful in 57s
CI / quality (pull_request) Successful in 1m0s
CI / typecheck (pull_request) Successful in 1m6s
CI / security (pull_request) Successful in 1m11s
CI / unit_tests (pull_request) Successful in 5m12s
CI / docker (pull_request) Successful in 1m26s
CI / integration_tests (pull_request) Successful in 8m20s
CI / coverage (pull_request) Successful in 8m43s
CI / status-check (pull_request) Successful in 3s
The plan correct --format json output already nests correction fields
under data.correction and sets command to "plan correct" via
format_output, so the three BDD scenarios now pass against the current
implementation. Remove the @tdd_expected_fail inversion tag so CI
reports them as passing, not as unexpected-pass failures.

Updated CHANGELOG.md and CONTRIBUTORS.md.

ISSUES CLOSED: #8584
2026-06-02 07:19:20 -04:00
HAL9000 a55322e69f fix(plan-correct): add spec-required JSON envelope with data.correction.mode 2026-06-02 07:19:20 -04:00
HAL9000 78066e96ec test(plan-correct): fix slow module-level import causing unit_tests timeout
Deferred the import of ``cleveragents.cli.commands.plan`` from module
level to a lazy helper ``_get_plan_app()``.  The module triggers a
~100 s import chain (application container, all services, repositories,
etc.) when loaded cold.  Loading it at step-definition import time
added that cost to every behave worker process before any scenario ran,
causing the unit_tests CI job to time out.

By deferring to the first step execution the module is already cached
in ``sys.modules`` (loaded by the many other step files that import it
at module level), so the actual cost at execution time is near-zero.

The three @tdd_expected_fail scenarios still fail with AssertionError
(data.correction.mode absent, command field empty) and the TDD
inversion hook correctly converts those failures to passes in CI.

ISSUES CLOSED: #8584
2026-06-02 07:19:20 -04:00
HAL9000 734c444c6a test(plan-correct): add failing BDD scenario proving JSON output missing spec envelope
Add @tdd_expected_fail BDD scenarios that prove the plan correct --format json
command outputs a flat dict instead of the spec-required nested envelope structure.
The scenarios assert data.correction.mode is present (currently absent) and that
the command field is "plan correct" (currently empty string).

ISSUES CLOSED: #8584
2026-06-02 07:19:20 -04:00