-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathrun.sh
33 lines (26 loc) · 902 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# Entry script to start Xvfb and set display
set -e
# Set the defaults
DEFAULT_LOG_LEVEL="INFO" # Available levels: TRACE, DEBUG, INFO (default), WARN, NONE (no logging)
DEFAULT_RES="1280x1024x24"
DEFAULT_DISPLAY=":99"
DEFAULT_ROBOT_TESTS="false"
# Use default if none specified as env var
LOG_LEVEL=${LOG_LEVEL:-$DEFAULT_LOG_LEVEL}
RES=${RES:-$DEFAULT_RES}
DISPLAY=${DISPLAY:-$DEFAULT_DISPLAY}
ROBOT_TESTS=${ROBOT_TESTS:-$ROBOT_TESTS}
if [[ "${ROBOT_TESTS}" == "false" ]]; then
echo "Error: Please specify the robot test or directory as env var ROBOT_TESTS"
exit 1
fi
# Start Xvfb
echo -e "Starting Xvfb on display ${DISPLAY} with res ${RES}"
Xvfb ${DISPLAY} -ac -screen 0 ${RES} +extension RANDR &
export DISPLAY=${DISPLAY}
# Execute tests
echo -e "Executing robot tests at log level ${LOG_LEVEL}"
pybot --loglevel ${LOG_LEVEL} ${ROBOT_TESTS}
# Stop Xvfb
kill -9 $(pgrep Xvfb)