From 4cd213d67f818eb9fc2faa2dd190ab399d4342d2 Mon Sep 17 00:00:00 2001 From: Norman Rzepka Date: Mon, 9 Dec 2024 16:11:19 +0000 Subject: [PATCH] --add-snapshots --- webknossos/test.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/webknossos/test.sh b/webknossos/test.sh index bb6323f59..f0d7cfdb3 100755 --- a/webknossos/test.sh +++ b/webknossos/test.sh @@ -31,6 +31,21 @@ if [ $# -gt 0 ] && [ "$1" = "--refresh-snapshots" ]; then stop_local_test_wk + exit $PYTEST_EXIT_CODE +elif [ $# -gt 0 ] && [ "$1" = "--add-snapshots" ]; then + ensure_local_test_wk + + # Starts a proxy server in record mode on port 3000 and sets the HTTP_PROXY env var + proxay --mode record --host http://localhost:9000 --tapes-dir tests/cassettes & + PROXAY_PID=$! + + shift + $PYTEST "-m" "use_proxay" "$@" + PYTEST_EXIT_CODE=$? + trap 'kill $PROXAY_PID' EXIT + + stop_local_test_wk + exit $PYTEST_EXIT_CODE elif [ $# -gt 0 ] && [ "$1" = "--debug-cassettes" ]; then # This will start a proxay server in replay mode so that the stored cassettes can be used for debugging tests.