Files
cleveragents-core/robot/cost_controls.robot
T
freemo 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
fix(test-infra): remove redundant ${PYTHON} variable definitions from robot files
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
2026-04-14 14:50:55 +00:00

80 lines
3.4 KiB
Plaintext

*** Settings ***
Resource ${CURDIR}/common.resource
Library OperatingSystem
Library Process
*** Variables ***
${SRC_DIR} ${CURDIR}/..
*** Test Cases ***
Cost Entry Creation And Estimation
[Documentation] Verify CostEntry creation and cost estimation
[Tags] cost_controls provider model
${result}= Run Process ${PYTHON} robot/helper_cost_controls.py cost-entry
... cwd=${SRC_DIR}
Log Process Failure ${result}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} cost-entry-ok
Provider Cost Table Lookup
[Documentation] Verify ProviderCostTable model lookup
[Tags] cost_controls provider model
${result}= Run Process ${PYTHON} robot/helper_cost_controls.py cost-table
... cwd=${SRC_DIR}
Log Process Failure ${result}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} cost-table-ok
Cost Tracker Budget Enforcement
[Documentation] Verify CostTracker budget enforcement
[Tags] cost_controls provider budget
${result}= Run Process ${PYTHON} robot/helper_cost_controls.py cost-tracker
... cwd=${SRC_DIR}
Log Process Failure ${result}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} cost-tracker-budget-ok
Fallback Selector No Providers
[Documentation] Verify FallbackSelector with no configured providers
[Tags] cost_controls provider fallback
${result}= Run Process ${PYTHON} robot/helper_cost_controls.py fallback-selector
... cwd=${SRC_DIR}
Log Process Failure ${result}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} fallback-selector-ok
Settings Cost Control Defaults
[Documentation] Verify Settings cost control config defaults
[Tags] cost_controls config settings
${result}= Run Process ${PYTHON} robot/helper_cost_controls.py settings-defaults
... cwd=${SRC_DIR}
Log Process Failure ${result}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} settings-defaults-ok
Cost Metadata Display Dict
[Documentation] Verify CostMetadata display dictionary
[Tags] cost_controls provider model
${result}= Run Process ${PYTHON} robot/helper_cost_controls.py cost-metadata
... cwd=${SRC_DIR}
Log Process Failure ${result}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} cost-metadata-display-ok
Cost Tracker Concurrent Record Usage Is Thread Safe
[Documentation] Verify CostTracker.record_usage is thread-safe: concurrent calls must not lose cost increments
[Tags] cost_controls provider concurrency
${result}= Run Process ${PYTHON} robot/helper_cost_controls.py cost-tracker-concurrent
... cwd=${SRC_DIR}
Log Process Failure ${result}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} cost-tracker-concurrent-ok
*** Keywords ***
Log Process Failure
[Arguments] ${result}
Run Keyword If ${result.rc} == 0 Return From Keyword
Log To Console Process failed with rc=${result.rc}
Log To Console STDOUT:${\n}${result.stdout}
Log To Console STDERR:${\n}${result.stderr}