Files
cleveragents-core/robot/resource_cli.robot
freemo 069b43233c 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-05 07:42:02 +00:00

40 lines
1.9 KiB
Plaintext

*** Settings ***
Library Process
Library OperatingSystem
Library String
Suite Setup Set Environment Variables
Suite Teardown Clean Up Test Database
Test Tags resource_cli
*** Variables ***
${DB_URL} sqlite:///build/test_resource_cli.db
*** Keywords ***
Set Environment Variables
Set Environment Variable CLEVERAGENTS_DATABASE_URL ${DB_URL}
Set Environment Variable CLEVERAGENTS_TESTING_USE_MOCK_AI true
${script}= Set Variable from cleveragents.infrastructure.database.models import Base; from sqlalchemy import create_engine; e \= create_engine("${DB_URL}"); Base.metadata.create_all(e)
${result}= Run Process ${PYTHON} -c ${script}
... env:PYTHONPATH=src timeout=120s on_timeout=kill
Should Be Equal As Integers ${result.rc} 0
Clean Up Test Database
Remove File build/test_resource_cli.db
*** Test Cases ***
Resource Type List Returns Output
[Documentation] Verify resource type list command runs without error
${result}= Run Process ${PYTHON} -m cleveragents resource type list
... env:PYTHONPATH=src env:CLEVERAGENTS_DATABASE_URL=${DB_URL} env:CLEVERAGENTS_TESTING_USE_MOCK_AI=true
... timeout=120s on_timeout=kill stderr=STDOUT
Log ${result.stdout}
Should Be Equal As Integers ${result.rc} 0
Resource Show Non Existent Returns Error
[Documentation] Verify resource show for non-existent resource fails gracefully
${result}= Run Process ${PYTHON} -m cleveragents resource show nonexistent
... env:PYTHONPATH=src env:CLEVERAGENTS_DATABASE_URL=${DB_URL} env:CLEVERAGENTS_TESTING_USE_MOCK_AI=true
... timeout=120s on_timeout=kill stderr=STDOUT
Log ${result.stdout}
Should Not Be Equal As Integers ${result.rc} 0