b122ec7ed5
CI / lint (pull_request) Successful in 23s
CI / quality (pull_request) Successful in 51s
CI / typecheck (pull_request) Successful in 1m0s
CI / security (pull_request) Successful in 55s
CI / build (pull_request) Successful in 25s
CI / helm (pull_request) Successful in 32s
CI / push-validation (pull_request) Successful in 26s
CI / e2e_tests (pull_request) Successful in 3m38s
CI / integration_tests (pull_request) Successful in 6m42s
CI / unit_tests (pull_request) Successful in 8m19s
CI / docker (pull_request) Successful in 13s
CI / coverage (pull_request) Successful in 15m23s
CI / status-check (pull_request) Successful in 2s
Remove the local ${PYTHON} python (and python3) variable definitions from
the *** Variables *** sections of all affected robot files. These local
definitions were overriding the pabot-injected venv Python path passed via
--variable PYTHON:/path/to/venv/python, causing tests to use the system
Python (which lacks required packages like structlog, sqlalchemy, etc.)
instead of the nox venv Python.
The correct ${PYTHON} value is already set by Setup Test Environment in
common.resource via sys.executable, and pabot passes it via --variable.
The local fallback definitions are redundant and harmful in parallel runs.
Audit found 56 robot files with the pattern (more than the 9 originally
identified in the issue). All occurrences have been removed.
ISSUES CLOSED: #1309
102 lines
3.7 KiB
Plaintext
102 lines
3.7 KiB
Plaintext
*** Settings ***
|
|
Documentation Simple context management test for CleverAgents CLI
|
|
... SEC1: Uses simple_echo_config.yaml which requires code blocks.
|
|
Library Process
|
|
Library OperatingSystem
|
|
Library String
|
|
Library DateTime
|
|
Resource ${CURDIR}/v2_paths.resource
|
|
Force Tags code_blocks
|
|
Suite Setup Setup Test Environment
|
|
Suite Teardown Cleanup Test Environment
|
|
|
|
*** Variables ***
|
|
${SIMPLE_CONFIG} ${V2_CONFIG_DIR}/simple_echo_config.yaml
|
|
${CONTEXT_DIR} ${TEMPDIR}/test_contexts
|
|
${UNIQUE_ID} ${EMPTY}
|
|
${TEMP} ${EMPTY}
|
|
|
|
*** Test Cases ***
|
|
Test Context Command Help
|
|
[Documentation] Verify context command help is available
|
|
${result} = Run Process ${PYTHON} -m cleveragents context --help
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} Context management
|
|
Should Contain ${result.stdout} clear
|
|
Should Contain ${result.stdout} Context management
|
|
|
|
Test Run With Context Creates Directory
|
|
[Documentation] Verify --context flag creates context directory
|
|
${context_name} = Set Variable ctx_${UNIQUE_ID}
|
|
|
|
# Use simple test config that exits cleanly
|
|
${result} = Run Process ${PYTHON} -m cleveragents actor run
|
|
... -c ${SIMPLE_CONFIG}
|
|
... --context ${context_name}
|
|
... --context-dir ${CONTEXT_DIR}
|
|
... --unsafe
|
|
... --allow-rxpy-in-run-mode
|
|
... test-actor "test message"
|
|
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Directory Should Exist ${CONTEXT_DIR}/${context_name}
|
|
|
|
Test Context Delete
|
|
[Documentation] Test context delete command
|
|
${context_name} = Set Variable del_${UNIQUE_ID}
|
|
|
|
# Create context
|
|
Run Process ${PYTHON} -m cleveragents actor run
|
|
... -c ${SIMPLE_CONFIG}
|
|
... --context ${context_name}
|
|
... --context-dir ${CONTEXT_DIR}
|
|
... --unsafe
|
|
... --allow-rxpy-in-run-mode
|
|
... test-actor "test"
|
|
|
|
Directory Should Exist ${CONTEXT_DIR}/${context_name}
|
|
|
|
# Delete it
|
|
${result} = Run Process ${PYTHON} -m cleveragents context delete
|
|
... ${context_name}
|
|
... --context-dir ${CONTEXT_DIR}
|
|
... --yes
|
|
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Directory Should Not Exist ${CONTEXT_DIR}/${context_name}
|
|
|
|
Test Context Clear
|
|
[Documentation] Test context clear command
|
|
${context_name} = Set Variable clear_${UNIQUE_ID}
|
|
|
|
# Create context
|
|
Run Process ${PYTHON} -m cleveragents actor run
|
|
... -c ${SIMPLE_CONFIG}
|
|
... --context ${context_name}
|
|
... --context-dir ${CONTEXT_DIR}
|
|
... --unsafe
|
|
... --allow-rxpy-in-run-mode
|
|
... test-actor "test"
|
|
|
|
# Clear it
|
|
${result} = Run Process ${PYTHON} -m cleveragents context clear
|
|
... ${context_name}
|
|
... --context-dir ${CONTEXT_DIR}
|
|
... --yes
|
|
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Directory Should Exist ${CONTEXT_DIR}/${context_name}
|
|
|
|
*** Keywords ***
|
|
Setup Test Environment
|
|
${timestamp} = Get Current Date result_format=%Y%m%d_%H%M%S
|
|
${random} = Evaluate random.randint(1000, 9999) modules=random
|
|
Set Suite Variable ${UNIQUE_ID} ${timestamp}_${random}
|
|
Set Suite Variable ${TEMP} ${TEMPDIR}/ca_test_${UNIQUE_ID}
|
|
Set Suite Variable ${CONTEXT_DIR} ${TEMP}/contexts
|
|
Create Directory ${TEMP}
|
|
Create Directory ${CONTEXT_DIR}
|
|
|
|
Cleanup Test Environment
|
|
Run Keyword And Ignore Error Remove Directory ${TEMP} recursive=True
|