Skip to content

Playwright: pre-build test apps before webServer startup - #5789

Open
nicoburns wants to merge 1 commit into
mainfrom
devin/1787832691-playwright-prebuild
Open

Playwright: pre-build test apps before webServer startup#5789
nicoburns wants to merge 1 commit into
mainfrom
devin/1787832691-playwright-prebuild

Conversation

@nicoburns

Copy link
Copy Markdown
Member

Summary

Playwright previously started ~20 dx run/cargo run webServers concurrently, each doing a full build at startup — ~20 cargo invocations racing over CPU and the target-dir lock, a major source of CI slowness and flaky server-startup failures.

This extends the existing _DX_BUILT one-time init block in playwright.config.js: after building dx, it now pre-builds every active test app sequentially (cargo parallelizes internally), so webServer startup is launch-only. The build command is derived from each server's run command:

preBuildCommand(s):
  command includes "--hot-patch"  -> null (skip: fat build isn't shared with plain `dx build`)
  "cargo run ..."                 -> "cargo build ..."          // liveview
  "dx run <flags>"                -> "dx build <flags>" minus serve-only `--addr`/`--port`

Keeping the remaining flags (--web, --release, --ssg, --bin, --wasm-split, --profile, --force-sequential) identical means the subsequent dx run hits the same cargo fingerprint and reuses all artifacts. Non-hot-patch dx run/dx serve builds use BuildMode::Base, same as dx build.

webServer timeout drops from 50 min to 10 min for pre-built servers; hot-patch servers (which still do their full fat build at startup) keep 50 min.

Local workflow is unchanged: activeServers already filters to the specs passed on the CLI, so a single-spec run only pre-builds that one app.

Verification

On Linux, ran npx playwright test web.spec.js web-routing.spec.js --reporter=line from a clean target state:

  • Pre-build phase compiled both apps sequentially (Pre-building web: ... dx build --force-sequential --web, then web-routing).
  • webServer startup did no crate compilation — logs show only Bundling app / Running WASM bindgen / Build completed successfully in 2.08s, launching app!.
  • All 19 tests passed (7.0s).

Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/1ad909911b2445319691f40122f4f2e9
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/1ad909911b2445319691f40122f4f2e9?variant=devin-insiders
Requested by: @nicoburns

@staging-devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant