Files
cleveragents-core/robot/scientific_paper_writer_test.robot
T
brent.edwards 51a6e76e9e
CI / lint (pull_request) Successful in 16s
CI / typecheck (pull_request) Successful in 28s
CI / security (pull_request) Successful in 21s
CI / quality (pull_request) Successful in 14s
CI / integration_tests (pull_request) Failing after 6m34s
CI / unit_tests (pull_request) Successful in 6m46s
CI / build (pull_request) Successful in 15s
CI / docker (pull_request) Successful in 8s
CI / coverage (pull_request) Successful in 5m8s
fix(ci): merge duplicate Settings blocks, inject venv Python, add CI debug
Three fixes targeting CI integration_tests failures (18 failures on e8aa5ac):

1. Merge duplicate *** Settings *** blocks in 14 robot files into single
   blocks. Multiple Settings sections are non-standard RF practice and
   may cause resource import failures in certain Robot Framework versions
   or CI environments.

2. Replace bare 'python' with ${PYTHON} variable in all Run Process
   calls (14 files). Noxfile now passes --variable PYTHON:<venv-path>
   to robot so tests use the venv interpreter regardless of PATH. This
   fixes '/usr/local/bin/python: No module named cleveragents' on CI.

3. Add comprehensive CI debug output in noxfile.py: file existence
   checks for .resource files, PATH/Python resolution, fixture dir
   checks, and RF version. This will diagnose any remaining resource
   import issues.

Also: remove hardcoded '/app/src' sys.path.insert in
system_prompt_template_rendering.robot (not portable to CI), and
add trailing newline to common.resource.

All 204 tests pass locally (4 excluded: 2 slow, 2 discovery).
2026-02-13 03:43:44 +00:00

95 lines
3.4 KiB
Plaintext

*** Settings ***
Documentation Integration test for Scientific Paper Writer context management
Library Process
Library OperatingSystem
Library String
Library DateTime
Resource ${CURDIR}/v2_paths.resource
Suite Setup Setup Test Environment
Suite Teardown Cleanup Test Environment
*** Variables ***
${PYTHON} python
${SIMPLE_CONFIG} ${V2_CONFIG_DIR}/simple_echo_config.yaml
${CONTEXT_DIR} ${TEMPDIR}/sciwri_contexts
${UNIQUE_ID} ${EMPTY}
${TEMP} ${EMPTY}
*** Test Cases ***
Test Context Export Import Commands
[Documentation] Test exporting and importing context
${source_ctx} = Set Variable export_${UNIQUE_ID}
${import_ctx} = Set Variable import_${UNIQUE_ID}
${export_file} = Set Variable ${TEMP}/export.json
# Create source context with simple config
Run Process ${PYTHON} -m cleveragents actor run
... -c ${SIMPLE_CONFIG}
... --context ${source_ctx}
... --context-dir ${CONTEXT_DIR}
... --unsafe
... --allow-rxpy-in-run-mode
... -p Hello world
... timeout=10s
# Export it
${result} = Run Process ${PYTHON} -m cleveragents context export
... ${source_ctx} ${export_file}
... --context-dir ${CONTEXT_DIR}
Should Be Equal As Integers ${result.rc} 0
File Should Exist ${export_file}
# Import to new context
${result} = Run Process ${PYTHON} -m cleveragents context import
... ${import_ctx} ${export_file}
... --context-dir ${CONTEXT_DIR}
Should Be Equal As Integers ${result.rc} 0
Directory Should Exist ${CONTEXT_DIR}/${import_ctx}
Test Context List Command
[Documentation] Test listing contexts
${ctx1} = Set Variable list1_${UNIQUE_ID}
${ctx2} = Set Variable list2_${UNIQUE_ID}
# Create two contexts with simple echo config
Run Process ${PYTHON} -m cleveragents actor run
... -c ${SIMPLE_CONFIG}
... --context ${ctx1}
... --context-dir ${CONTEXT_DIR}
... --unsafe
... --allow-rxpy-in-run-mode
... -p First
... timeout=10s
Run Process ${PYTHON} -m cleveragents actor run
... -c ${SIMPLE_CONFIG}
... --context ${ctx2}
... --context-dir ${CONTEXT_DIR}
... --unsafe
... --allow-rxpy-in-run-mode
... -p Second
... timeout=10s
# List them
${result} = Run Process ${PYTHON} -m cleveragents context list
... --context-dir ${CONTEXT_DIR}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} ${ctx1}
Should Contain ${result.stdout} ${ctx2}
*** 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}/sciwri_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