ci(web-e2e): prebuild server so Playwright webServer stops timing out #94

Merged
funman300 merged 1 commits from ci/web-e2e-prebuild-server into master 2026-06-22 19:11:23 +00:00
Owner

Problem

web-e2e has been failing on every run (including on fresh wasm from #92), so the regenerated artifacts didn't turn CI green. The log shows it's not a web regression — the browser tests never ran:

> playwright test
Error: Timed out waiting 120000ms from config.webServer.

Playwright's webServer runs cargo run -p solitaire_server --quiet and waits 120s for /health. The workflow cached only npm — no Rust cache — so each run cold-compiled the whole server graph (axum / sqlx / reqwest / aws-lc-sys) inside that 120s window and never came up. Pure timeout, no panic, no assertion failure.

Fix

Make the harness actually run the tests:

  • Swatinem/rust-cache@v2 — warm the cargo cache across runs.
  • Prebuild step (SQLX_OFFLINE=true cargo build -p solitaire_server) before Playwright, so webServer's cargo run reuses the compiled binary and starts in seconds. The .sqlx/ offline query cache is committed, so no live DB is needed at build time.
  • webServer.timeout 120s → 300s as a safety margin for a cold cargo cache (e.g. first run after a deps bump).

Why this matters

Until the webServer starts, the e2e suite can't tell us anything about the actual browser game. With this fix the Playwright tests run for real and will confirm whether the web build is healthy post-migration — the question behind "the web version isn't working."

Validated: web-e2e.yml parses; playwright.config.js passes node --check.

🤖 Generated with Claude Code

## Problem `web-e2e` has been failing on **every** run (including on fresh wasm from #92), so the regenerated artifacts didn't turn CI green. The log shows it's not a web regression — the browser tests never ran: ``` > playwright test Error: Timed out waiting 120000ms from config.webServer. ``` Playwright's `webServer` runs `cargo run -p solitaire_server --quiet` and waits **120s** for `/health`. The workflow cached **only npm — no Rust cache** — so each run **cold-compiled the whole server graph** (axum / sqlx / reqwest / aws-lc-sys) inside that 120s window and never came up. Pure timeout, no panic, no assertion failure. ## Fix Make the harness actually run the tests: - **`Swatinem/rust-cache@v2`** — warm the cargo cache across runs. - **Prebuild step** (`SQLX_OFFLINE=true cargo build -p solitaire_server`) before Playwright, so `webServer`'s `cargo run` reuses the compiled binary and starts in seconds. The `.sqlx/` offline query cache is committed, so no live DB is needed at build time. - **`webServer.timeout` 120s → 300s** as a safety margin for a cold cargo cache (e.g. first run after a deps bump). ## Why this matters Until the `webServer` starts, the e2e suite can't tell us anything about the actual browser game. With this fix the Playwright tests run for real and will confirm whether the web build is healthy post-migration — the question behind "the web version isn't working." Validated: `web-e2e.yml` parses; `playwright.config.js` passes `node --check`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
funman300 added 1 commit 2026-06-22 19:10:06 +00:00
The web-e2e job has been failing on every run with:

    Error: Timed out waiting 120000ms from config.webServer.

Playwright's `webServer` runs `cargo run -p solitaire_server --quiet` and
waits 120s for /health. The workflow cached only npm — no Rust cache — so each
run cold-compiled the entire server graph (axum/sqlx/reqwest/aws-lc-sys) inside
that 120s window and never came up. The browser tests never executed; the
failure was infra, not a web regression.

Fix the harness so the tests actually run:
- add `Swatinem/rust-cache@v2` to warm the cargo cache across runs
- add a `Prebuild server` step (`SQLX_OFFLINE=true cargo build -p
  solitaire_server`) before Playwright, so `webServer`'s `cargo run` reuses the
  compiled binary and starts in seconds (.sqlx offline cache is committed)
- raise `webServer.timeout` 120s -> 300s as a safety margin for a cold cargo
  cache (e.g. first run after a deps bump)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
funman300 merged commit b3a8575bbd into master 2026-06-22 19:11:23 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: funman300/Ferrous-Solitaire#94