ci(web-e2e): prebuild server so Playwright webServer stops timing out #94
Reference in New Issue
Block a user
Delete Branch "ci/web-e2e-prebuild-server"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
web-e2ehas 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's
webServerrunscargo run -p solitaire_server --quietand 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.SQLX_OFFLINE=true cargo build -p solitaire_server) before Playwright, sowebServer'scargo runreuses the compiled binary and starts in seconds. The.sqlx/offline query cache is committed, so no live DB is needed at build time.webServer.timeout120s → 300s as a safety margin for a cold cargo cache (e.g. first run after a deps bump).Why this matters
Until the
webServerstarts, 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.ymlparses;playwright.config.jspassesnode --check.🤖 Generated with Claude Code
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>