diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 7dafa3af..5bf14826 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -213,59 +213,17 @@ jobs: - name: Install Playwright browsers run: npx playwright install --with-deps ${{ matrix.browser }} - - name: Install Frontend Dependencies - run: | - echo "📦 Installing frontend dependencies..." - cd frontend - npm ci - - - name: Start Vite dev server for coverage - run: | - echo "🚀 Starting Vite dev server for E2E coverage..." - cd frontend - - # Use port 5173 (Vite default) with --strictPort to fail if busy - VITE_PORT=5173 - npx vite --port ${VITE_PORT} --strictPort > /tmp/vite.log 2>&1 & - VITE_PID=$! - echo "VITE_PID=${VITE_PID}" >> $GITHUB_ENV - echo "VITE_PORT=${VITE_PORT}" >> $GITHUB_ENV - - # Wait for Vite to be ready - echo "⏳ Waiting for Vite to start on port ${VITE_PORT}..." - MAX_WAIT=60 - WAITED=0 - while [[ ${WAITED} -lt ${MAX_WAIT} ]]; do - if curl -sf http://localhost:${VITE_PORT} > /dev/null 2>&1; then - echo "✅ Vite dev server ready at http://localhost:${VITE_PORT}" - exit 0 - fi - sleep 1 - WAITED=$((WAITED + 1)) - done - - echo "❌ Vite failed to start" - cat /tmp/vite.log - exit 1 - - name: Run E2E tests (Shard ${{ matrix.shard }}/${{ matrix.total-shards }}) run: | npx playwright test \ --project=${{ matrix.browser }} \ --shard=${{ matrix.shard }}/${{ matrix.total-shards }} env: - # Use Vite dev server for coverage (proxies API to Docker at 8080) - PLAYWRIGHT_BASE_URL: http://localhost:${{ env.VITE_PORT }} + # Test directly against Docker container (no coverage) + PLAYWRIGHT_BASE_URL: http://localhost:8080 CI: true TEST_WORKER_INDEX: ${{ matrix.shard }} - - name: Stop Vite dev server - if: always() - run: | - if [[ -n "${VITE_PID}" ]]; then - kill ${VITE_PID} 2>/dev/null || true - fi - - name: Upload test results if: always() uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 @@ -276,14 +234,6 @@ jobs: test-results/ retention-days: 7 - - name: Upload E2E coverage artifact - if: always() - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 - with: - name: e2e-coverage-shard-${{ matrix.shard }} - path: coverage/e2e/ - retention-days: 7 - - name: Upload test traces on failure if: failure() uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 @@ -479,11 +429,14 @@ jobs: } # Upload merged E2E coverage to Codecov + # TEMPORARILY DISABLED: Coverage collection skipped for diagnostic purposes + # Re-enable after confirming tests pass without Vite dev server overhead upload-coverage: name: Upload E2E Coverage runs-on: ubuntu-latest needs: e2e-tests - if: always() && needs.e2e-tests.result == 'success' + if: false # Disabled - no coverage being collected + steps: - name: Checkout repository diff --git a/docs/plans/current_spec.md b/docs/plans/current_spec.md index 90a073f6..edbcfa59 100644 --- a/docs/plans/current_spec.md +++ b/docs/plans/current_spec.md @@ -91,10 +91,12 @@ npx playwright test - [x] Fix Go cache path in e2e-tests.yml workflow - [x] Optimize global-setup.ts to prevent hanging on emergency reset - [x] Fix E2E coverage generation (remove --reporter override) +- [x] Disable E2E coverage collection (remove Vite dev server) - [ ] Commit with clear diagnostic message - [ ] Trigger CI run - [ ] Analyze results and document findings - [ ] Restore security tests once diagnosis complete +- [ ] Re-evaluate E2E coverage strategy (Vite vs Docker vs separate job) --- @@ -191,3 +193,52 @@ npx playwright test \ - ✅ E2E coverage will now be generated in `coverage/e2e/` - ✅ Coverage artifacts will upload successfully - ✅ Codecov will receive E2E coverage data for frontend code + +**UPDATE**: Coverage generation has been **temporarily disabled** to isolate test failures. + +### E2E Coverage Disabled (Diagnostic) + +**Issue**: Tests were running against Vite dev server (port 5173) for coverage collection, adding significant overhead and complexity. + +**Hypothesis**: The dual-environment setup (Docker + Vite) may be causing test instability or failures. + +**Changes Applied**: +1. **Removed Vite dev server setup** - No longer starts frontend dev server +2. **Removed frontend dependency installation** - Saves ~60s per shard +3. **Changed PLAYWRIGHT_BASE_URL** - Now points directly to Docker container (localhost:8080) +4. **Disabled coverage artifacts** - Removed E2E coverage upload steps +5. **Disabled upload-coverage job** - Marked with `if: false` + +**Before**: +```yaml +- name: Install Frontend Dependencies + run: cd frontend && npm ci + +- name: Start Vite dev server for coverage + run: npx vite --port 5173 & + +env: + PLAYWRIGHT_BASE_URL: http://localhost:5173 # Vite with source maps +``` + +**After**: +```yaml +# Frontend deps removed - not needed +# Vite server removed - not needed + +env: + PLAYWRIGHT_BASE_URL: http://localhost:8080 # Direct to Docker +``` + +**Impact**: +- ✅ **~60-90 seconds faster** per shard (no frontend install + Vite startup) +- ✅ **Simpler architecture** - single environment (Docker only) +- ✅ **Matches local testing** - tests against production-like container +- ⚠️ **No E2E coverage** - will need to re-enable after diagnosis + +**If Tests Pass**: The Vite/coverage setup was causing issues. Can either: +1. Keep coverage disabled for speed +2. Create separate coverage-only job (non-sharded) +3. Investigate and fix Vite setup issues + +**If Tests Still Fail**: Issue is not related to coverage/Vite - deeper investigation needed.