Skip to content

Commit

Permalink
--add-snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
normanrz committed Dec 9, 2024
1 parent 4545559 commit 4cd213d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions webknossos/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4cd213d

Please sign in to comment.