diff --git a/run_tests.sh b/run_tests.sh index b96ee0b..26868bb 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -4,13 +4,24 @@ set -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# Auto-detect and configure local SOCKS5 proxy if active on 7890 +if nc -z 127.0.0.1 7890 >/dev/null 2>&1; then + echo "=== Auto-detected local proxy on port 7890. Enabling proxy... ===" + export http_proxy=socks5://127.0.0.1:7890 + export https_proxy=socks5://127.0.0.1:7890 + export all_proxy=socks5://127.0.0.1:7890 + export HTTP_PROXY=socks5://127.0.0.1:7890 + export HTTPS_PROXY=socks5://127.0.0.1:7890 + export ALL_PROXY=socks5://127.0.0.1:7890 +fi + echo "=== Setting up Python Virtual Environment ===" if [ ! -d "$DIR/backend/.venv" ]; then python3 -m venv "$DIR/backend/.venv" fi echo "=== Installing Dependencies ===" -"$DIR/backend/.venv/bin/pip" install -q -r "$DIR/backend/requirements.txt" +"$DIR/backend/.venv/bin/pip" install -r "$DIR/backend/requirements.txt" echo "=== Executing Test Suite ===" "$DIR/backend/.venv/bin/python3" -m pytest "$DIR/backend/tests/"