13e23a6a8a
The TDD invariant persistence suite was using `Setup Test Environment` (no DB isolation) but its helper script (helper_tdd_invariant_persistence.py) relies on InvariantService cross-instance persistence. Without CLEVERAGENTS_DATABASE_URL set, InvariantService falls back to in-memory mode (invariant_service.py:90) and the second helper invocation cannot see invariants written by the first — every TDD scenario fails: - TDD Invariant Add Then List Project Across Invocations - TDD Invariant Add Then List Global Across Invocations - TDD Invariant Remove Cross Instance Switch the suite setup to `Setup Test Environment With Database Isolation` so each suite gets a unique sqlite path via the existing keyword in robot/common.resource. This also prevents pabot worker collisions on the default `sqlite:///cleveragents.db`. ISSUES CLOSED: #8573
43 lines
2.1 KiB
Plaintext
43 lines
2.1 KiB
Plaintext
*** Settings ***
|
|
Documentation TDD Issue #1022 — InvariantService invariant persistence
|
|
... These tests verify that invariants added via the CLI persist
|
|
... across simulated process restarts. Each test is a separate
|
|
... CLI invocation that adds then lists or removes an invariant.
|
|
Resource ${CURDIR}/common.resource
|
|
Suite Setup Setup Test Environment With Database Isolation
|
|
Suite Teardown Cleanup Test Environment
|
|
|
|
*** Variables ***
|
|
${HELPER} ${CURDIR}/helper_tdd_invariant_persistence.py
|
|
|
|
*** Test Cases ***
|
|
TDD Invariant Add Then List Project Across Invocations
|
|
[Documentation] Add a project invariant in invocation 1, list in invocation 2.
|
|
[Tags] tdd_issue tdd_issue_1022 tdd_issue tdd_issue_4318
|
|
|
|
${result}= Run Process ${PYTHON} ${HELPER} add-then-list-project cwd=${WORKSPACE} timeout=30s on_timeout=kill
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} invariant-persist-project-ok
|
|
|
|
TDD Invariant Add Then List Global Across Invocations
|
|
[Documentation] Add a global invariant in invocation 1, list in invocation 2.
|
|
[Tags] tdd_issue tdd_issue_1022 tdd_issue tdd_issue_4318
|
|
|
|
${result}= Run Process ${PYTHON} ${HELPER} add-then-list-global cwd=${WORKSPACE} timeout=30s on_timeout=kill
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} invariant-persist-global-ok
|
|
|
|
TDD Invariant Remove Cross Instance
|
|
[Documentation] Add invariant in instance 1, remove by ID in instance 2.
|
|
[Tags] tdd_issue tdd_issue_1022 tdd_issue tdd_issue_4318
|
|
|
|
${result}= Run Process ${PYTHON} ${HELPER} add-then-remove-cross cwd=${WORKSPACE} timeout=30s on_timeout=kill
|
|
Log ${result.stdout}
|
|
Log ${result.stderr}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} invariant-cross-remove-ok
|