lc-core/tests/run.sh

35 lines
717 B
Bash
Raw Normal View History

2021-04-02 16:42:00 +05:30
set -ex
2021-04-02 15:42:47 +05:30
python3 -m venv testEnv
2021-04-02 16:51:48 +05:30
source ./testEnv/bin/activate
2021-04-02 15:42:47 +05:30
pip install locust
mkdir -p data/
2022-04-13 07:34:11 +05:30
java -jar target/scala-3.1.2/LibreCaptcha.jar &
2021-04-02 15:42:47 +05:30
JAVA_PID=$!
sleep 4
locust --only-summary --headless -u 300 -r 100 --run-time 4m --stop-timeout 30 -f tests/locustfile.py
status=$?
2021-04-02 15:42:47 +05:30
if [ $status != 0 ]; then
exit $status
fi
kill $JAVA_PID
sleep 4
echo Run functional test
cp data/config.json data/config.json.bak
cp tests/debug-config.json data/config.json
2022-04-13 07:34:11 +05:30
java -jar target/scala-3.1.2/LibreCaptcha.jar &
JAVA_PID=$!
sleep 4
locust --only-summary --headless -u 1 -r 1 --run-time 1m --stop-timeout 30 -f tests/locustfile-functional.py
status=$?
mv data/config.json.bak data/config.json
kill $JAVA_PID
exit $status