test: add TDD bug-capture test for #1079 — project context set missing flag #1130

Merged
brent.edwards merged 4 commits from tdd/m5-context-exec-env-priority-flag into master 2026-03-28 02:14:56 +00:00
Member

Summary

This PR adds TDD bug-capture tests for bug #1079 (project context set missing --execution-env-priority flag). Per the Bug Fix Workflow in CONTRIBUTING.md, the first step in fixing any bug is to write a test that proves the bug exists.

What was done

  • Behave unit tests (6 scenarios in features/project_context_set_exec_env_priority.feature):

    • project context set --execution-env-priority override with --execution-environment should succeed and persist
    • project context set --execution-env-priority fallback with --execution-environment should succeed and persist
    • --execution-env-priority without --execution-environment should be rejected
    • Default to fallback when only --execution-environment is specified
    • Invalid --execution-env-priority value should be rejected
    • project context show should reflect persisted execution_env_priority in JSON output
  • Robot integration tests (3 test cases in robot/project_context_set_exec_env_priority.robot):

    • Override acceptance with persistence verification
    • Fallback acceptance with persistence verification
    • Full round-trip persistence check

All tests are tagged @tdd_bug @tdd_bug_1079 @tdd_expected_fail. The underlying assertions fail (confirming the bug exists — --execution-env-priority is "No such option"), and the @tdd_expected_fail tag inverts the result so CI passes.

Bug confirmed

The context_set() function in cleveragents.cli.commands.project_context does not accept execution_env_priority as a parameter. The specification (§Execution Environment Routing, precedence table) requires this flag at precedence level 2 for project-level execution environment priority control.

Quality gates

Gate Result
nox -s lint PASS
nox -s typecheck PASS (0 errors)
nox -s unit_tests PASS (12236 scenarios, 0 failed)
nox -s integration_tests My 3 tests pass (13 pre-existing failures)
nox -s coverage_report PASS (98%, threshold 97%)

Closes #1100

## Summary This PR adds TDD bug-capture tests for bug #1079 (`project context set` missing `--execution-env-priority` flag). Per the Bug Fix Workflow in CONTRIBUTING.md, the first step in fixing any bug is to write a test that proves the bug exists. ### What was done - **Behave unit tests** (6 scenarios in `features/project_context_set_exec_env_priority.feature`): - `project context set --execution-env-priority override` with `--execution-environment` should succeed and persist - `project context set --execution-env-priority fallback` with `--execution-environment` should succeed and persist - `--execution-env-priority` without `--execution-environment` should be rejected - Default to `fallback` when only `--execution-environment` is specified - Invalid `--execution-env-priority` value should be rejected - `project context show` should reflect persisted `execution_env_priority` in JSON output - **Robot integration tests** (3 test cases in `robot/project_context_set_exec_env_priority.robot`): - Override acceptance with persistence verification - Fallback acceptance with persistence verification - Full round-trip persistence check All tests are tagged `@tdd_bug @tdd_bug_1079 @tdd_expected_fail`. The underlying assertions fail (confirming the bug exists — `--execution-env-priority` is "No such option"), and the `@tdd_expected_fail` tag inverts the result so CI passes. ### Bug confirmed The `context_set()` function in `cleveragents.cli.commands.project_context` does not accept `execution_env_priority` as a parameter. The specification (§Execution Environment Routing, precedence table) requires this flag at precedence level 2 for project-level execution environment priority control. ### Quality gates | Gate | Result | |------|--------| | `nox -s lint` | PASS | | `nox -s typecheck` | PASS (0 errors) | | `nox -s unit_tests` | PASS (12236 scenarios, 0 failed) | | `nox -s integration_tests` | My 3 tests pass (13 pre-existing failures) | | `nox -s coverage_report` | PASS (98%, threshold 97%) | Closes #1100
brent.edwards added this to the v3.5.0 milestone 2026-03-23 11:58:15 +00:00
freemo approved these changes 2026-03-24 15:28:33 +00:00
Dismissed
freemo left a comment

Review: APPROVED

TDD tags correct. Both Behave AND Robot Framework tests present — one of only 3 TDD PRs in the batch with dual-framework coverage. Step definitions fully implemented. Good CHANGELOG.

Minor Note

Uses per-scenario @tdd_expected_fail tagging rather than feature-level — functionally fine but inconsistent with other TDD PRs in the batch that tag at the feature level. Not blocking.

## Review: APPROVED TDD tags correct. Both Behave AND Robot Framework tests present — one of only 3 TDD PRs in the batch with dual-framework coverage. Step definitions fully implemented. Good CHANGELOG. ### Minor Note Uses per-scenario `@tdd_expected_fail` tagging rather than feature-level — functionally fine but inconsistent with other TDD PRs in the batch that tag at the feature level. Not blocking.
Author
Member

Self-QA status: QA process was started but interrupted before completing. The PR has not yet been reviewed by the self-QA loop. Manual review recommended.

**Self-QA status:** QA process was started but interrupted before completing. The PR has not yet been reviewed by the self-QA loop. Manual review recommended.
brent.edwards force-pushed tdd/m5-context-exec-env-priority-flag from 61cd3b236e
All checks were successful
CI / build (pull_request) Successful in 25s
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 3m18s
CI / typecheck (pull_request) Successful in 3m50s
CI / quality (pull_request) Successful in 4m0s
CI / security (pull_request) Successful in 4m21s
CI / unit_tests (pull_request) Successful in 6m6s
CI / integration_tests (pull_request) Successful in 6m44s
CI / docker (pull_request) Successful in 1m5s
CI / e2e_tests (pull_request) Successful in 8m30s
CI / coverage (pull_request) Successful in 11m15s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-regression (pull_request) Successful in 1h6m24s
to 5adfa8e3d9
Some checks failed
CI / status-check (pull_request) Blocked by required conditions
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Failing after 22s
CI / lint (pull_request) Successful in 3m18s
CI / quality (pull_request) Successful in 3m42s
CI / typecheck (pull_request) Successful in 3m55s
CI / coverage (pull_request) Has started running
CI / security (pull_request) Successful in 4m3s
CI / benchmark-regression (pull_request) Has started running
CI / e2e_tests (pull_request) Successful in 8m32s
CI / unit_tests (pull_request) Successful in 9m9s
CI / integration_tests (pull_request) Successful in 9m10s
CI / docker (pull_request) Successful in 1m22s
2026-03-25 01:48:08 +00:00
Compare
brent.edwards dismissed freemo's review 2026-03-25 01:48:08 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

brent.edwards force-pushed tdd/m5-context-exec-env-priority-flag from db5f93bb8d
Some checks failed
CI / build (pull_request) Successful in 16s
CI / lint (pull_request) Successful in 3m22s
CI / quality (pull_request) Successful in 3m40s
CI / security (pull_request) Successful in 4m1s
CI / typecheck (pull_request) Successful in 4m22s
CI / unit_tests (pull_request) Successful in 6m12s
CI / docker (pull_request) Successful in 16s
CI / integration_tests (pull_request) Successful in 6m57s
CI / e2e_tests (pull_request) Successful in 9m44s
CI / benchmark-publish (pull_request) Has been skipped
CI / coverage (pull_request) Successful in 12m5s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-regression (pull_request) Failing after 35m18s
to 62ad5ab091
All checks were successful
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 1m3s
CI / lint (pull_request) Successful in 7m23s
CI / typecheck (pull_request) Successful in 7m50s
CI / quality (pull_request) Successful in 8m10s
CI / security (pull_request) Successful in 8m25s
CI / integration_tests (pull_request) Successful in 10m42s
CI / unit_tests (pull_request) Successful in 13m44s
CI / docker (pull_request) Successful in 1m10s
CI / e2e_tests (pull_request) Successful in 15m45s
CI / coverage (pull_request) Successful in 11m30s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-regression (pull_request) Successful in 1h9m17s
2026-03-26 20:03:28 +00:00
Compare
freemo approved these changes 2026-03-27 17:12:03 +00:00
Dismissed
freemo left a comment

Review: test: add TDD bug-capture test for #1079 — project context set missing flag

Approved. One of the most comprehensive TDD PRs in this batch.

Minor Note

Missing CHANGELOG.md entry — most other TDD PRs include one. Consider adding for consistency.

What's Good

  • 6 BDD scenarios covering override, fallback, validation (priority without env), defaults, invalid values, and show round-trip.
  • Full Robot Framework suite with helper script.
  • _SafeSession wrapper pattern and in-memory DB setup are well-structured.
  • Proper @tdd_expected_fail and @tdd_bug tags.
## Review: test: add TDD bug-capture test for #1079 — project context set missing flag **Approved.** One of the most comprehensive TDD PRs in this batch. ### Minor Note Missing CHANGELOG.md entry — most other TDD PRs include one. Consider adding for consistency. ### What's Good - 6 BDD scenarios covering override, fallback, validation (priority without env), defaults, invalid values, and show round-trip. - Full Robot Framework suite with helper script. - `_SafeSession` wrapper pattern and in-memory DB setup are well-structured. - Proper `@tdd_expected_fail` and `@tdd_bug` tags.
brent.edwards force-pushed tdd/m5-context-exec-env-priority-flag from 62ad5ab091
All checks were successful
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 1m3s
CI / lint (pull_request) Successful in 7m23s
CI / typecheck (pull_request) Successful in 7m50s
CI / quality (pull_request) Successful in 8m10s
CI / security (pull_request) Successful in 8m25s
CI / integration_tests (pull_request) Successful in 10m42s
CI / unit_tests (pull_request) Successful in 13m44s
CI / docker (pull_request) Successful in 1m10s
CI / e2e_tests (pull_request) Successful in 15m45s
CI / coverage (pull_request) Successful in 11m30s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-regression (pull_request) Successful in 1h9m17s
to b5c65f4356
Some checks failed
CI / build (pull_request) Successful in 15s
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 3m19s
CI / quality (pull_request) Successful in 3m46s
CI / typecheck (pull_request) Successful in 3m55s
CI / security (pull_request) Successful in 4m10s
CI / integration_tests (pull_request) Failing after 6m11s
CI / unit_tests (pull_request) Failing after 6m17s
CI / docker (pull_request) Has been skipped
CI / e2e_tests (pull_request) Successful in 12m29s
CI / coverage (pull_request) Successful in 12m39s
CI / status-check (pull_request) Failing after 1s
CI / benchmark-regression (pull_request) Has been cancelled
2026-03-27 23:20:56 +00:00
Compare
brent.edwards dismissed freemo's review 2026-03-27 23:20:56 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

brent.edwards force-pushed tdd/m5-context-exec-env-priority-flag from b2b6dbd2da
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 20s
CI / helm (pull_request) Successful in 21s
CI / lint (pull_request) Successful in 3m38s
CI / quality (pull_request) Successful in 3m43s
CI / security (pull_request) Successful in 4m7s
CI / typecheck (pull_request) Successful in 4m13s
CI / integration_tests (pull_request) Successful in 6m49s
CI / unit_tests (pull_request) Successful in 7m5s
CI / docker (pull_request) Successful in 1m32s
CI / e2e_tests (pull_request) Successful in 11m37s
CI / coverage (pull_request) Successful in 8m27s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-regression (pull_request) Has been cancelled
to f0d7456b7d
Some checks failed
CI / status-check (pull_request) Blocked by required conditions
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 17s
CI / helm (pull_request) Successful in 41s
CI / lint (pull_request) Successful in 3m23s
CI / quality (pull_request) Successful in 3m51s
CI / typecheck (pull_request) Successful in 3m54s
CI / benchmark-regression (pull_request) Has started running
CI / integration_tests (pull_request) Failing after 4m0s
CI / security (pull_request) Successful in 4m6s
CI / unit_tests (pull_request) Successful in 4m19s
CI / docker (pull_request) Successful in 2m17s
CI / coverage (pull_request) Successful in 12m45s
CI / e2e_tests (pull_request) Failing after 18m42s
2026-03-28 01:37:59 +00:00
Compare
test(tdd): stabilize implicit-init integration helper
All checks were successful
CI / benchmark-publish (pull_request) Has been skipped
CI / helm (pull_request) Successful in 33s
CI / build (pull_request) Successful in 33s
CI / lint (pull_request) Successful in 3m20s
CI / quality (pull_request) Successful in 4m1s
CI / typecheck (pull_request) Successful in 4m7s
CI / security (pull_request) Successful in 4m11s
CI / integration_tests (pull_request) Successful in 7m36s
CI / unit_tests (pull_request) Successful in 7m41s
CI / docker (pull_request) Successful in 10s
CI / e2e_tests (pull_request) Successful in 11m37s
CI / coverage (pull_request) Successful in 12m0s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-regression (pull_request) Successful in 57m17s
3539e33929
brent.edwards deleted branch tdd/m5-context-exec-env-priority-flag 2026-03-28 02:14:56 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core!1130
No description provided.