Skip to content

Commit

Permalink
add timeout and fix test path
Browse files Browse the repository at this point in the history
  • Loading branch information
LogFlames committed Dec 8, 2024
1 parent f8c1a68 commit 77c3f15
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/backend_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ jobs:
- name: Run tests
working-directory: ./backend/bittan
run: |
timeout=30
start_time=$SECONDS
ssh -o "StrictHostKeyChecking no" -R 80:localhost:8000 serveo.net > serveo.log 2>&1 &
PID=$!
Expand All @@ -58,11 +61,15 @@ jobs:
if grep -q 'HTTP' "serveo.log"; then
break
fi
if (( SECONDS - start_time >= timeout )); then
echo "Timeout reached. Exiting."
exit 1
fi
done
url=$(grep -oP 'https://[a-f0-9]+\.serveo\.net' "serveo.log")
export APPLICATION_URL=$url
python3 manage.py test ./tests/bittan --exclude-tag=no_ci
python3 manage.py test ./bittan/tests --exclude-tag=no_ci
kill $PID

0 comments on commit 77c3f15

Please sign in to comment.