From bc816437b6a9fd7d716af17b7bef17e9a65761da Mon Sep 17 00:00:00 2001 From: Arnav Naval Date: Thu, 30 Apr 2026 23:47:18 -0500 Subject: [PATCH] [arnav] fix(ci): install local debug package via requirements-dev --- .github/workflows/test.yml | 2 ++ backend/requirements-dev.txt | 2 ++ scripts/test.sh | 11 +++++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index df7f98de..47ccedf3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,6 +34,8 @@ jobs: backend/requirements-dev.txt - name: Install backend deps + # Default cwd in GH Actions is the repo root, which is required for + # the `-e ./debugger` line in backend/requirements-dev.txt to resolve. run: | python -m pip install --upgrade pip python -m pip install \ diff --git a/backend/requirements-dev.txt b/backend/requirements-dev.txt index 529d6051..4f15a9fc 100644 --- a/backend/requirements-dev.txt +++ b/backend/requirements-dev.txt @@ -9,3 +9,5 @@ pytest==8.3.4 pytest-asyncio==0.25.2 + +-e ./debugger \ No newline at end of file diff --git a/scripts/test.sh b/scripts/test.sh index 24124c64..03d0792f 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -38,6 +38,14 @@ if [[ ! -x "$PYTHON_BIN" ]]; then python3 -m venv "$VENV_DIR" fi +# Pinned to project root so: +# 1. `from backend.apps...` imports resolve when pytest runs (same as +# before — see end of file). +# 2. The `-e ./debugger` line in backend/requirements-dev.txt resolves +# correctly. pip resolves relative paths in requirements files +# relative to CWD, not the requirements file's directory. +cd "$PROJECT_ROOT" + # --- Ensure pytest is installed (idempotent: only re-installs if missing) - if ! "$PYTHON_BIN" -c "import pytest, pytest_asyncio" >/dev/null 2>&1; then echo "==> Installing backend deps + dev deps into $VENV_DIR" @@ -58,7 +66,6 @@ if [[ "$QUICK" -eq 1 ]]; then echo "==> --quick: DISCONNECT_STRESS_N=$DISCONNECT_STRESS_N" fi -# Run from project root so `from backend.apps...` imports resolve. -cd "$PROJECT_ROOT" +# Already cd'd to $PROJECT_ROOT above so `from backend.apps...` resolves. echo "==> Running: pytest ${PYTEST_ARGS[*]}" exec "$PYTHON_BIN" -m pytest "${PYTEST_ARGS[@]}"