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_output/*
|
||||||
test_results/*
|
test_results/*
|
||||||
tests/robot/output/*
|
tests/robot/output/*
|
||||||
tests/robot/results/log.html
|
tests/robot/results/*
|
||||||
tests/robot/results/output.xml
|
|
||||||
tests/robot/results/playwright-log.txt
|
|
||||||
tests/robot/results/report.html
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ Resource ${CURDIR}/resources/common.resource
|
|||||||
|
|
||||||
Suite Setup Run Keywords
|
Suite Setup Run Keywords
|
||||||
... Start Aniworld Server
|
... Start Aniworld Server
|
||||||
|
... AND Create Anonymous Session
|
||||||
... AND Wait For Server
|
... AND Wait For Server
|
||||||
... AND Initialize Browser
|
... AND Initialize Browser
|
||||||
|
|
||||||
|
|||||||
@@ -26,14 +26,12 @@ ${SERVER_PROCESS} ${EMPTY}
|
|||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
Start Aniworld Server
|
Start Aniworld Server
|
||||||
[Documentation] Start the FastAPI uvicorn server as a background process.
|
[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
|
${handle}= Start Process bash /home/lukas/Volume/repo/Aniworld/tests/robot/start_server.sh
|
||||||
... --host ${SERVER_HOST} --port ${SERVER_PORT}
|
|
||||||
... --no-access-log
|
|
||||||
... cwd=/home/lukas/Volume/repo/Aniworld
|
... cwd=/home/lukas/Volume/repo/Aniworld
|
||||||
... stdout=${CURDIR}/../fixtures/server_stdout.log
|
... stdout=${CURDIR}/../fixtures/server_stdout.log
|
||||||
... stderr=${CURDIR}/../fixtures/server_stderr.log
|
... stderr=${CURDIR}/../fixtures/server_stderr.log
|
||||||
Set Suite Variable ${SERVER_PROCESS} ${result}
|
Set Suite Variable ${SERVER_PROCESS} ${handle}
|
||||||
Sleep 3s
|
Sleep 5s
|
||||||
|
|
||||||
Stop Aniworld Server
|
Stop Aniworld Server
|
||||||
[Documentation] Terminate the uvicorn server process and clean up log files.
|
[Documentation] Terminate the uvicorn server process and clean up log files.
|
||||||
@@ -49,8 +47,8 @@ Wait For Server
|
|||||||
${resp}= Run Keyword And Ignore Error
|
${resp}= Run Keyword And Ignore Error
|
||||||
... GET On Session anon /health expected_status=any
|
... GET On Session anon /health expected_status=any
|
||||||
IF '${resp}[0]' == 'PASS'
|
IF '${resp}[0]' == 'PASS'
|
||||||
${status_code}= Set Variable ${resp}[1].status_code
|
${status_code}= Evaluate $resp[1].status_code
|
||||||
IF ${status_code} == 200 or ${status_code} == 503
|
IF $status_code == 200 or $status_code == 503
|
||||||
RETURN
|
RETURN
|
||||||
END
|
END
|
||||||
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