2021-04-02 07:12:00 -04:00
|
|
|
set -ex
|
|
|
|
|
2021-04-02 06:12:47 -04:00
|
|
|
python3 -m venv testEnv
|
2021-04-02 07:21:48 -04:00
|
|
|
source ./testEnv/bin/activate
|
2021-04-02 06:12:47 -04:00
|
|
|
pip install locust
|
2021-04-19 09:21:20 -04:00
|
|
|
mkdir -p data/
|
2024-10-25 00:33:18 -04:00
|
|
|
java -jar target/scala-3.5.2/LibreCaptcha.jar &
|
2021-04-02 06:12:47 -04:00
|
|
|
JAVA_PID=$!
|
|
|
|
sleep 4
|
|
|
|
|
2021-04-13 00:16:51 -04:00
|
|
|
locust --only-summary --headless -u 300 -r 100 --run-time 4m --stop-timeout 30 -f tests/locustfile.py
|
2021-04-02 07:11:33 -04:00
|
|
|
status=$?
|
2021-04-02 06:12:47 -04:00
|
|
|
|
2021-04-12 10:55:31 -04:00
|
|
|
if [ $status != 0 ]; then
|
|
|
|
exit $status
|
|
|
|
fi
|
|
|
|
|
2021-04-12 23:35:44 -04:00
|
|
|
kill $JAVA_PID
|
|
|
|
sleep 4
|
|
|
|
|
2021-04-12 10:55:31 -04:00
|
|
|
echo Run functional test
|
2021-04-12 23:35:44 -04:00
|
|
|
cp data/config.json data/config.json.bak
|
|
|
|
cp tests/debug-config.json data/config.json
|
|
|
|
|
2024-10-25 01:15:44 -04:00
|
|
|
java -jar target/scala-3.5.2/LibreCaptcha.jar &
|
2021-04-12 23:35:44 -04:00
|
|
|
JAVA_PID=$!
|
|
|
|
sleep 4
|
|
|
|
|
2021-04-13 00:16:51 -04:00
|
|
|
locust --only-summary --headless -u 1 -r 1 --run-time 1m --stop-timeout 30 -f tests/locustfile-functional.py
|
2021-04-12 10:55:31 -04:00
|
|
|
status=$?
|
2021-04-12 23:35:44 -04:00
|
|
|
mv data/config.json.bak data/config.json
|
2021-04-02 07:11:33 -04:00
|
|
|
|
2021-04-12 10:55:31 -04:00
|
|
|
kill $JAVA_PID
|
2021-04-02 07:11:33 -04:00
|
|
|
exit $status
|