fix(robot): resolve suite setup hangs and RF7 syntax errors
- Replace blocking Run Process with Start Process for uvicorn server
- Fix RF7 IF condition syntax: ${status_code} → $status_code
- Add bash wrapper script for reliable conda env server startup
- Add Create Anonymous Session to suite setup for health check polling
- Simplify .gitignore for robot results
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -93,7 +93,4 @@ robot_results/*
|
||||
test_output/*
|
||||
test_results/*
|
||||
tests/robot/output/*
|
||||
tests/robot/results/log.html
|
||||
tests/robot/results/output.xml
|
||||
tests/robot/results/playwright-log.txt
|
||||
tests/robot/results/report.html
|
||||
tests/robot/results/*
|
||||
|
||||
@@ -9,6 +9,7 @@ Resource ${CURDIR}/resources/common.resource
|
||||
|
||||
Suite Setup Run Keywords
|
||||
... Start Aniworld Server
|
||||
... AND Create Anonymous Session
|
||||
... AND Wait For Server
|
||||
... AND Initialize Browser
|
||||
|
||||
|
||||
@@ -26,14 +26,12 @@ ${SERVER_PROCESS} ${EMPTY}
|
||||
# ---------------------------------------------------------------------------
|
||||
Start Aniworld Server
|
||||
[Documentation] Start the FastAPI uvicorn server as a background process.
|
||||
${result}= Run Process conda run -n AniWorld python -m uvicorn src.server.fastapi_app:app
|
||||
... --host ${SERVER_HOST} --port ${SERVER_PORT}
|
||||
... --no-access-log
|
||||
${handle}= Start Process bash /home/lukas/Volume/repo/Aniworld/tests/robot/start_server.sh
|
||||
... cwd=/home/lukas/Volume/repo/Aniworld
|
||||
... stdout=${CURDIR}/../fixtures/server_stdout.log
|
||||
... stderr=${CURDIR}/../fixtures/server_stderr.log
|
||||
Set Suite Variable ${SERVER_PROCESS} ${result}
|
||||
Sleep 3s
|
||||
Set Suite Variable ${SERVER_PROCESS} ${handle}
|
||||
Sleep 5s
|
||||
|
||||
Stop Aniworld Server
|
||||
[Documentation] Terminate the uvicorn server process and clean up log files.
|
||||
@@ -49,8 +47,8 @@ Wait For Server
|
||||
${resp}= Run Keyword And Ignore Error
|
||||
... GET On Session anon /health expected_status=any
|
||||
IF '${resp}[0]' == 'PASS'
|
||||
${status_code}= Set Variable ${resp}[1].status_code
|
||||
IF ${status_code} == 200 or ${status_code} == 503
|
||||
${status_code}= Evaluate $resp[1].status_code
|
||||
IF $status_code == 200 or $status_code == 503
|
||||
RETURN
|
||||
END
|
||||
END
|
||||
|
||||
4
tests/robot/start_server.sh
Normal file
4
tests/robot/start_server.sh
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
# Wrapper script to start the Aniworld FastAPI server for Robot Framework tests
|
||||
cd /home/lukas/Volume/repo/Aniworld
|
||||
exec /home/lukas/miniconda3/envs/AniWorld/bin/python -m uvicorn src.server.fastapi_app:app --host 127.0.0.1 --port 8765 --no-access-log
|
||||
Reference in New Issue
Block a user