diff --git a/tests/debug-config.json b/tests/debug-config.json new file mode 100644 index 0000000..ae04974 --- /dev/null +++ b/tests/debug-config.json @@ -0,0 +1,14 @@ +{ + "randomSeed" : 20, + "port" : 8888, + "captchaExpiryTimeLimit" : 5, + "throttle" : 10, + "threadDelay" : 2, + "captchas" : [ { + "name" : "DebugCaptcha", + "allowedLevels" : [ "debug" ], + "allowedMedia" : [ "image/png" ], + "allowedInputType" : [ "text" ], + "config" : { } + }] +} diff --git a/tests/run.sh b/tests/run.sh index b00e7fa..9a07c97 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -11,13 +11,23 @@ locust --headless -u 300 -r 100 --run-time 4m --stop-timeout 30 -f tests/locustf status=$? if [ $status != 0 ]; then - kill $JAVA_PID 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 + +java -jar target/scala-2.13/LibreCaptcha.jar & +JAVA_PID=$! +sleep 4 + locust --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