Files
cleveragents-core/robot/scientific_paper_basic.robot
Dev f3b78c64b3
CI / lint (pull_request) Successful in 14s
CI / build (pull_request) Successful in 18s
CI / quality (pull_request) Successful in 22s
CI / typecheck (pull_request) Successful in 29s
CI / security (pull_request) Successful in 35s
CI / integration_tests (pull_request) Successful in 2m9s
CI / unit_tests (pull_request) Successful in 3m33s
CI / docker (pull_request) Successful in 1m17s
CI / coverage (pull_request) Successful in 10m32s
fix(test): increase robot test timeouts to 120s and fix DB migration hang
Process timeouts (SIGTERM/rc=-15) caused 19 integration test failures
across 6 suites. CLI cold-start imports the entire application stack
eagerly, making 10-30s timeouts insufficient.

- Raise all Run Process timeouts to 120s in 6 robot files
- Set CLEVERAGENTS_AUTO_APPLY_MIGRATIONS=true in database_integration
  test header to prevent typer.confirm() blocking on stdin
2026-02-19 00:11:20 +00:00

89 lines
3.1 KiB
Plaintext

*** Settings ***
Library Process
Library OperatingSystem
Library String
Resource ${CURDIR}/v2_paths.resource
Suite Setup Setup Test Environment
Suite Teardown Cleanup Test Environment
*** Variables ***
${PYTHON} python
${CONFIG_FILE} ${CURDIR}/../examples/scientific_paper_writer.yaml
${CONTEXT_DIR} ${TEMPDIR}/paper_basic_contexts
${CONTEXT_NAME} ${EMPTY}
${TEST_ID} ${EMPTY}
*** Test Cases ***
Scientific Paper Writer Basic Integration Test
[Documentation] Minimal integration test to verify scientific paper writer works with real APIs
[Tags] integration
[Timeout] 2 minutes
# Test 1: Basic intro response (uses OpenAI API)
${result}= Run Process ${PYTHON} -m cleveragents actor run
... -c ${CONFIG_FILE}
... --context ${CONTEXT_NAME}
... --context-dir ${CONTEXT_DIR}
... --unsafe
... --allow-rxpy-in-run-mode
... -p Hello
... stderr=DEVNULL
... timeout=120s
Should Contain ${result.stdout} Paper Writer
Log Intro test passed
# Test 2: Command handler (no API needed)
${result}= Run Process ${PYTHON} -m cleveragents actor run
... -c ${CONFIG_FILE}
... --context ${CONTEXT_NAME}
... --context-dir ${CONTEXT_DIR}
... --unsafe
... --allow-rxpy-in-run-mode
... -p !help
... stderr=DEVNULL
... timeout=120s
Should Contain ${result.stdout} Available Commands
Log Command handler test passed
# Test 3: Echo test to verify framework works
${result}= Run Process ${PYTHON} -m cleveragents actor run
... -c ${V2_CONFIG_DIR}/simple_echo_config.yaml
... --unsafe
... --allow-rxpy-in-run-mode
... -p Test message
... stderr=DEVNULL
... timeout=120s
Should Contain ${result.stdout} Test message
Log Echo test passed
Log All integration tests passed successfully
*** Keywords ***
Setup Test Environment
Require OpenAI Key
${timestamp}= Get Time epoch
Set Suite Variable ${TEST_ID} ${timestamp}
Set Suite Variable ${CONTEXT_NAME} test_paper_simple_${TEST_ID}
Set Suite Variable ${CONTEXT_DIR} ${TEMPDIR}/paper_basic_contexts
Create Directory ${CONTEXT_DIR}
Log Test environment setup complete with ID: ${TEST_ID}
Cleanup Test Environment
Run Keyword If '${CONTEXT_DIR}' != '${EMPTY}' Remove Directory ${CONTEXT_DIR} recursive=True
Log Test environment cleaned up
Should Contain Any
[Arguments] ${text} @{patterns}
FOR ${pattern} IN @{patterns}
${status}= Run Keyword And Return Status Should Contain ${text} ${pattern}
IF ${status} RETURN
END
Fail Text does not contain any of: @{patterns}
Require OpenAI Key
${api_key}= Get Environment Variable OPENAI_API_KEY default=
Run Keyword If '${api_key}' == '' Skip OPENAI_API_KEY not set; skipping LLM integration tests