Repository navigation
Conversation
EMDASH_E2E_BUILD=production now builds the Node fixture with `astro build --devOutput` and serves dist/server/entry.mjs instead of running `astro dev`. The build keeps `import.meta.env.DEV` true, so the dev-bypass, dev-reset and captured-email endpoints the suite depends on work without any test switch in EmDash. Also fixes what a built fixture exposes: manual i18n routing so the fixture's [locale] pages win over Astro's fallback routes, sharp for the image endpoint, the registry fixture installed at server start, an https image URL for the CSP, and an ignore rule for the migrations journal that builds write into the fixture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The build-time registry check only allowed localhost for `astro dev` and `astro sync`, while the runtime check follows import.meta.env.DEV. A --devOutput build therefore failed at build time although the built site would accept the URL. Astro sets NODE_ENV=development for --devOutput before loading the config, so the build check uses that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ostenbom
force-pushed
the
e2e/dev-output-build
branch
from
October 27, 2026 20:49
a1be93e to
7f36235
Compare
9 of 22 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Runs the Node Playwright suite against a built site instead of
astro dev, using Astro'sastro build --devOutput. It is one of four PRs comparing ways to speed up the E2E sweep (see Related PRs). This one keeps EmDash's behaviour under test as close toastro devas possible and changes one line of core.EMDASH_E2E_BUILD=productionswitchese2e/global-setup.tsfromastro devtoastro build --devOutputplusnode dist/server/entry.mjs. A dev-output build keepsimport.meta.env.DEVtrue, so the dev-bypass login, dev-reset and captured-email endpoints the suite depends on work with no test switch. Runs without the variable still useastro dev. CI sets it for the Node shards only; the Cloudflare step and the 8-shard layout are unchanged.Why each part is needed
global-setup.ts: build with--devOutput, servedist/server/entry.mjs, skip the page and admin warm-upsastro devcompiles on first request and reloads after optimizing dependencies. A build has neither. The SQLite path is baked into the build, so the data folder is fixed ($TMPDIR/emdash-pw-production) and cleared each run.integration/index.ts: build-time registry check accepts localhost whenNODE_ENV=developmenthttp://127.0.0.1:4445. The build-time check allowed localhost only forastro dev/astro sync, soastro build --devOutputfailed with "must use HTTPS outside development", even though the built site's runtime check (import.meta.env.DEV) accepts it. Astro setsNODE_ENV=developmentfor--devOutputbefore loading the config. Production builds still reject it (covered by a new unit test).EMDASH_SITE_URLset for the build and serverimage.remotePatternsfor EmDash media is derived from the site URL at build time.e2e/fixture:i18n.routing: "manual"plus a pass-throughsrc/middleware.ts[locale]pages, so/fr/posts/<slug>showed the English post.e2e/fixture:sharpdependencyMissingSharp;astro devfound Astro's optional copy.outer-middleware.tsinstalls the registry fixture at startupastro.config.mjsinstalls it, and a built server never runs the config.editor-image-panel.spec.tsuses anhttps://image URLhttps:images. Playwright intercepts the URL either way..gitignore:e2e/fixture*/.emdash/migrations.jsonThree tests that fail only when the whole suite runs against one server are fixed in #10. The CI shards don't need that fix; a full local run does.
How much it helps
Bottom line: after syncing with upstream, a real production build cuts the Node E2E time by about 60% with the 8-shard layout unchanged (#7: slowest shard 7.1 → 2.8 min). A dev-output build saves about a quarter (#6: 7.1 → 5.5 min) and fails on Endform at concurrency 64 on every attempt (#8). The production build on Endform (#9) runs the whole suite in one job in under 6 minutes, install and build included.
Local, native Playwright, 1 worker, full Node suite (378 tests), same Mac, run back to back:
astro devastro devmainastro build --devOutputastro build+dangerouslyEnableTestHooksastro build+ runtimeEMDASH_INSECURE_TEST_BYPASS(prototype)* The same flaky test both times:
media-library.spec.ts"moves one local media item into a visible folder by dragging", which fails about 1 run in 3 when the root folder is crowded. It isn't specific to production builds.CI, GitHub Actions
ubuntu-latest, after syncing with upstreammain(c1efce5cc):astro devmainastro build --devOutputastro build+dangerouslyEnableTestHooksastro build --devOutputon Endformastro build+dangerouslyEnableTestHookson Endformastro build+ runtime switch on EndformFor the shard rows, wall time is the slowest shard's "Run Node E2E" step and runner time is that step summed over all 8 shards. Install, build and the Cloudflare step are left out because they don't change between methods. emdash-cms#4317 now builds the fixtures before that step, which is why every shard number is lower than before the sync. Before the sync, against the older baseline (8.0 min, 42.6 shard-min), the shard results were the same picture: #6 −26% and #7 −51%, and on Endform #9 took 4m55s with no retries. For the Endform rows, wall time is the whole job, install and build included.
***
visual-editing.spec.ts"flushes unsaved edits when navigating away", the known Endform keepalive issue, andmedia-library.spec.ts"matches the compact responsive folder layout".** The same dev-output build passes natively (344 of 344), and its client bundles are within 3% of the production build's (4.9 MB vs 4.8 MB of gzipped JS). The extra time is most likely server-side rendering in development mode, which the one shared server can't keep up with at 64 tests at once. That is the same gap as in the native timings (10.3 vs 6.0 min). Not profiled further.
Runs after the sync: #6 CI, #7 CI, #8 Endform E2E, #9 Endform E2E. Before the sync: #6, #7, #8, #9. One or two runs each, so treat small differences as noise.
Other checks: Smoke Isolated Install passes after the sync, since upstream now installs the newest Node 22 for it. Browser Tests (the admin Vitest browser suite, which none of these PRs touch) still fails intermittently on these runners. It fails with "Failed to fetch dynamically imported module" / "Cannot connect to the iframe" on a different file each attempt, and once locally with a timing assertion (
PortableTextEditor.test.tsx, toolbar fade) that passes 3 of 3 times on its own. After the sync it passed first time on #6 and #10, and on the third attempt on #7.The dev-output build keeps less than half of the true production build's gain. A guess, not yet profiled: development React and unminified bundles, plus dev-only code paths in Astro and EmDash, stay on in a dev-output build.
Related PRs
astro build --devOutputastro builddangerouslyEnableTestHooksoptionastro build --devOutputastro buildastro buildwith a runtime env switchType of change
Your connection to this change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change): full Node E2E suite against the dev-output build (344 passed, 34 skipped), plus the newregistry-localhost-buildunit test, which fails without the fixpnpm formathas been runAI assistance disclosure
Screenshots / test output
Not applicable. Timings are in the table above.
🤖 Generated with Claude Code