fix(e2e): build packages before Playwright starts dev servers#1410
Conversation
Moves package builds out of Playwright's globalSetup and into the test:e2e:* npm scripts (pnpm build:packages && ...), so Vite/Angular never observe a partially rebuilt dist/. globalSetup now only asserts the built artifacts exist. Also restores the execSync import that runBuildPackages() removal accidentally dropped, which was breaking the ui-e2e CI job with a misleading "Auth emulator cannot start" error.
There was a problem hiding this comment.
Code Review
This pull request refactors the E2E testing setup by moving the package build step out of Playwright's globalSetup and directly into the individual test:e2e:* scripts in package.json. This ensures packages are fully built before Playwright starts the dev servers, preventing issues with partially rebuilt files. The reviewer suggests optimizing these scripts by leveraging pnpm's dependency filtering (e.g., pnpm --filter=... build) to build only the necessary dependencies for each specific test, which would significantly speed up local test execution.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
mikehardy
left a comment
There was a problem hiding this comment.
works for me - all the code looks ✅ and if this timing is better DX that's fine of course - this stuff is all very new so I personally have no preferences other than "make it work" :-)
Summary
globalSetupand into thetest:e2e:*npm scripts (pnpm build:packages && ...), so Vite/Angular dev servers never start against a partially-rebuiltdist/.globalSetupnow only asserts the built package artifacts exist (assertPackagesBuilt()), instead of also being responsible for triggering the build.execSyncimport ine2e/global-setup.tsthat was accidentally dropped when the now-removedrunBuildPackages()helper was deleted. ThatReferenceErrorwas being swallowed and rethrown as a misleading "Auth emulator cannot start" error, failing theui-e2eCI job before any tests could run.AD-4indeveloper-docs/decisions.md,playwright-e2e-smoke.md, andLOCAL_DEVELOPMENT.mdto reflect the new build timing and Node version guidance.Split out of #1355 so the e2e/build-infra changes can be reviewed independently of the
onUpgradeFailureauth feature (AD-10).