diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index ab362dc..97bd6b8 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -72,6 +72,8 @@ jobs: - name: Build backend run: cargo build --release + env: + DATABASE_URL: postgres://postgres:postgres@localhost:5432/readur_test - name: Build frontend working-directory: ./frontend @@ -106,39 +108,16 @@ jobs: working-directory: ./frontend run: npx playwright install --with-deps - - name: Start frontend dev server - working-directory: ./frontend - run: | - npm run dev & - echo $! > frontend.pid - env: - VITE_API_URL: http://localhost:8000 - - - name: Wait for frontend to be ready - run: | - for i in {1..30}; do - if curl -f http://localhost:5173 > /dev/null 2>&1; then - echo "Frontend is ready" - break - fi - echo "Waiting for frontend... ($i/30)" - sleep 2 - done - - name: Run frontend E2E tests working-directory: ./frontend run: npm run test:e2e env: VITE_API_URL: http://localhost:8000 - - name: Stop servers + - name: Stop backend server if: always() run: | if [ -f backend.pid ]; then kill $(cat backend.pid) || true rm backend.pid - fi - if [ -f frontend.pid ]; then - kill $(cat frontend.pid) || true - rm frontend.pid fi \ No newline at end of file