feat(tests): enable RUST_BACKTRACE on all tests, for debugging

This commit is contained in:
perf3ct 2025-06-19 21:56:00 +00:00
parent 440d6e3f6e
commit b19123e6f2
5 changed files with 10 additions and 0 deletions

View File

@ -74,6 +74,7 @@ jobs:
run: cargo build --release run: cargo build --release
env: env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/readur_test DATABASE_URL: postgres://postgres:postgres@localhost:5432/readur_test
RUST_BACKTRACE: 1
- name: Build frontend - name: Build frontend
working-directory: ./frontend working-directory: ./frontend
@ -92,6 +93,7 @@ jobs:
FRONTEND_PATH: ./frontend/dist FRONTEND_PATH: ./frontend/dist
UPLOAD_PATH: ./uploads UPLOAD_PATH: ./uploads
WATCH_PATH: ./watch WATCH_PATH: ./watch
RUST_BACKTRACE: 1
- name: Wait for backend to be ready - name: Wait for backend to be ready
run: | run: |
@ -104,6 +106,7 @@ jobs:
sleep 2 sleep 2
done done
- name: Install Playwright browsers - name: Install Playwright browsers
working-directory: ./frontend working-directory: ./frontend
run: npx playwright install --with-deps run: npx playwright install --with-deps
@ -113,6 +116,7 @@ jobs:
run: npm run test:e2e run: npm run test:e2e
env: env:
VITE_API_URL: http://localhost:8000 VITE_API_URL: http://localhost:8000
PLAYWRIGHT_BASE_URL: http://localhost:8000
- name: Stop backend server - name: Stop backend server
if: always() if: always()

View File

@ -109,6 +109,7 @@ jobs:
DATABASE_URL: ${{ env.DATABASE_URL }} DATABASE_URL: ${{ env.DATABASE_URL }}
TEST_DATABASE_URL: ${{ env.DATABASE_URL }} TEST_DATABASE_URL: ${{ env.DATABASE_URL }}
RUST_LOG: debug RUST_LOG: debug
RUST_BACKTRACE: 1
- name: Stop readur server - name: Stop readur server
if: always() if: always()

View File

@ -53,6 +53,8 @@ jobs:
run: | run: |
cargo test --lib cargo test --lib
cargo test --tests unit_tests cargo test --tests unit_tests
env:
RUST_BACKTRACE: 1
frontend-unit-tests: frontend-unit-tests:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -58,6 +58,7 @@ services:
# Test-specific environment variables # Test-specific environment variables
RUST_LOG: debug RUST_LOG: debug
RUST_BACKTRACE: 1
TEST_ENV: true TEST_ENV: true
ports: ports:

View File

@ -185,6 +185,7 @@ run_unit_tests() {
local exit_code local exit_code
output=$(DATABASE_URL="postgresql://readur_test:readur_test@localhost:5433/readur_test" \ output=$(DATABASE_URL="postgresql://readur_test:readur_test@localhost:5433/readur_test" \
RUST_BACKTRACE=1 \
cargo test --lib --no-fail-fast 2>&1) cargo test --lib --no-fail-fast 2>&1)
exit_code=$? exit_code=$?
@ -217,6 +218,7 @@ run_integration_tests() {
DATABASE_URL="postgresql://readur_test:readur_test@localhost:5433/readur_test" \ DATABASE_URL="postgresql://readur_test:readur_test@localhost:5433/readur_test" \
TEST_DATABASE_URL="postgresql://readur_test:readur_test@localhost:5433/readur_test" \ TEST_DATABASE_URL="postgresql://readur_test:readur_test@localhost:5433/readur_test" \
API_URL="http://localhost:8001" \ API_URL="http://localhost:8001" \
RUST_BACKTRACE=1 \
cargo test --test '*' --no-fail-fast 2>&1 | tee "$output_file" cargo test --test '*' --no-fail-fast 2>&1 | tee "$output_file"
exit_code=${PIPESTATUS[0]} exit_code=${PIPESTATUS[0]}