26632f79e9
CI / build (push) Successful in 18s
CI / helm (push) Successful in 21s
CI / lint (push) Successful in 3m17s
CI / quality (push) Successful in 3m41s
CI / typecheck (push) Successful in 4m3s
CI / security (push) Successful in 4m4s
CI / benchmark-regression (push) Has been skipped
CI / integration_tests (push) Successful in 7m7s
CI / unit_tests (push) Successful in 7m15s
CI / docker (push) Successful in 1m31s
CI / e2e_tests (push) Successful in 12m39s
CI / coverage (push) Successful in 11m32s
CI / status-check (push) Successful in 1s
CI / benchmark-publish (push) Successful in 29m36s
## 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 Reviewed-on: #1130 Reviewed-by: Jeffrey Phillips Freeman <jeffrey.freeman@cleverthis.com> Co-authored-by: Brent E. Edwards <brent.edwards@cleverthis.com> Co-committed-by: Brent E. Edwards <brent.edwards@cleverthis.com>
46 lines
2.5 KiB
Plaintext
46 lines
2.5 KiB
Plaintext
*** Settings ***
|
|
Documentation TDD Bug #1023 — CLI commands should succeed without explicit init
|
|
... Integration smoke tests verifying that DB-dependent CLI commands
|
|
... (e.g., ``resource add``, ``project create``) succeed in a fresh
|
|
... environment where ``agents init`` has NOT been run, when
|
|
... ``CLEVERAGENTS_AUTO_APPLY_MIGRATIONS=true`` is set.
|
|
...
|
|
... Bug #1023 reports that ``CLEVERAGENTS_AUTO_APPLY_MIGRATIONS=true``
|
|
... triggers migrations on an existing database but does NOT create
|
|
... the database file or its parent directory structure.
|
|
Resource ${CURDIR}/common.resource
|
|
Suite Setup Setup Test Environment
|
|
Suite Teardown Cleanup Test Environment
|
|
|
|
*** Variables ***
|
|
${HELPER} ${CURDIR}/helper_tdd_e2e_implicit_init.py
|
|
|
|
*** Test Cases ***
|
|
TDD Resource Add Succeeds Without Explicit Init
|
|
[Documentation] Verify that ``resource add`` succeeds in a fresh
|
|
... environment without prior ``agents init`` when
|
|
... ``CLEVERAGENTS_AUTO_APPLY_MIGRATIONS=true`` is set.
|
|
... The helper exits 0 with a sentinel when the command
|
|
... succeeds (bug is fixed), and exits 1 when the bug is
|
|
... present (OperationalError).
|
|
[Tags] tdd_expected_fail tdd_issue tdd_issue_1023
|
|
${result}= Run Process ${PYTHON} ${HELPER} resource-add-no-init cwd=${WORKSPACE} timeout=120s on_timeout=kill
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} tdd-resource-add-no-init-ok
|
|
|
|
TDD Project Create Succeeds Without Explicit Init
|
|
[Documentation] Verify that ``project create`` succeeds in a fresh
|
|
... environment without prior ``agents init`` when
|
|
... ``CLEVERAGENTS_AUTO_APPLY_MIGRATIONS=true`` is set.
|
|
... The helper exits 0 with a sentinel when the command
|
|
... succeeds (bug is fixed), and exits 1 when the bug is
|
|
... present (OperationalError).
|
|
[Tags] tdd_expected_fail tdd_issue tdd_issue_1023
|
|
${result}= Run Process ${PYTHON} ${HELPER} project-create-no-init cwd=${WORKSPACE} timeout=120s on_timeout=kill
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} tdd-project-create-no-init-ok
|