test(phase-22b): cover optional-lastName edit in settings panel #134
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: E2E | |
| # Playwright end-to-end tests. Boots the full docker-compose stack | |
| # (backend + frontend + runner image), then drives the app via headless | |
| # Chromium. OpenAI is mocked at the network layer — no real API hits from CI. | |
| # | |
| # Kept as a separate workflow (not a job in ci.yml) because this one needs | |
| # Docker + the full runner image build, which is materially slower than the | |
| # lint/typecheck/unit jobs. Keeping them apart means a broken e2e run does | |
| # not block the fast-feedback signal on unit tests. | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| - '.github/ISSUE_TEMPLATE/**' | |
| - 'LICENSE' | |
| pull_request: | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| - '.github/ISSUE_TEMPLATE/**' | |
| - 'LICENSE' | |
| concurrency: | |
| group: e2e-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| e2e: | |
| name: Playwright (chromium) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| # Phase 18d: cloud-only Supabase model. These feed both docker compose | |
| # (which reads process env for ${VAR} interpolation in docker-compose.yml) | |
| # and the Playwright specs (fixtures + auth.spec.ts read process.env). | |
| # Values come from the codetutor-dev project — see docs/DEVELOPMENT.md. | |
| env: | |
| SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | |
| SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }} | |
| SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }} | |
| VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }} | |
| VITE_SUPABASE_ANON_KEY: ${{ secrets.VITE_SUPABASE_ANON_KEY }} | |
| DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
| BYOK_ENCRYPTION_KEY: ${{ secrets.BYOK_ENCRYPTION_KEY }} | |
| # Phase 20-P3: e2e-only bearer for /api/metrics. Not a real secret — | |
| # the backend validates against this exact string, and the metrics | |
| # spec uses it to prove the authed path works. Local runs can set | |
| # METRICS_TOKEN in .env to the same value, or leave it blank (in | |
| # which case the spec's token branch skips). | |
| METRICS_TOKEN: e2e-test-metrics-token | |
| # Phase 20-P3: Playwright cycles test pages faster than `pagehide`-driven | |
| # session cleanup reaches the backend, so prod-tight caps (2/user) block | |
| # the next test for the full sweeper interval (~45 s) and manifest as | |
| # "Run Code button disabled 30 s" flakes that pass on retry. The auth | |
| # fixture now explicitly ends each test's session in afterEach (see | |
| # e2e/fixtures/auth.ts), which drops the per-user leak rate dramatically; | |
| # the loose cap below is belt-and-suspenders for any session id the | |
| # sniffer misses (early-failed tests, mid-flight rebinds). Prod posture | |
| # (config.ts defaults 2/20/8) is unaffected. | |
| MAX_SESSIONS_PER_USER: "60" | |
| MAX_SESSIONS_GLOBAL: "200" | |
| DOCKER_EXEC_CONCURRENCY: "16" | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| cache-dependency-path: e2e/package-lock.json | |
| - name: Boot docker-compose stack | |
| run: docker compose up -d backend frontend | |
| - name: Install e2e deps | |
| working-directory: e2e | |
| run: npm ci | |
| - name: Cache Playwright browsers | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-playwright-${{ hashFiles('e2e/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-playwright- | |
| - name: Install Playwright browsers | |
| working-directory: e2e | |
| run: npx playwright install --with-deps chromium | |
| - name: Run Playwright tests | |
| working-directory: e2e | |
| run: npx playwright test | |
| - name: Dump docker-compose logs on failure | |
| if: failure() | |
| run: docker compose logs --no-color --tail=300 | |
| - name: Upload Playwright report | |
| if: always() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: playwright-report | |
| path: e2e/playwright-report | |
| retention-days: 14 | |
| if-no-files-found: ignore | |
| - name: Upload Playwright traces/videos | |
| if: failure() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: playwright-traces | |
| path: e2e/test-results | |
| retention-days: 14 | |
| if-no-files-found: ignore | |
| - name: Tear down docker-compose | |
| if: always() | |
| run: docker compose down -v |