Repository navigation
Conversation
PR template validation failedPlease fix the following issues by editing your PR description:
See CONTRIBUTING.md for the full contribution policy. |
This was referenced Oct 27, 2026
The dev-bypass, dev-reset and captured-email endpoints, the console email provider and localhost registry URLs are gated on import.meta.env.DEV, so an end-to-end suite that signs in through them can only run against `astro dev`. The new integration option sets a build-time constant that the shared isDevOnlyEnabled() gate reads alongside import.meta.env.DEV. A build without the option gets `false`, so nothing at runtime can switch the endpoints on, and the build-time registry check accepts localhost only when the option is set. `astro build` warns while it is on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EMDASH_E2E_BUILD=production now runs `astro build` on the Node fixture and serves dist/server/entry.mjs instead of running `astro dev`. The fixture sets dangerouslyEnableTestHooks so the suite can still sign in and reset the site, and EMDASH_SITE_URL because production setup and image.remotePatterns need it. 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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ostenbom
force-pushed
the
e2e/production-build-flag
branch
from
October 27, 2026 20:49
dc5dae7 to
4660103
Compare
9 of 22 tasks
ostenbom
marked this pull request as ready for review
October 29, 2026 23:47
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?
Most of the Node E2E time goes to
astro dev, and running the suite against a real production build was the biggest win I found. The catch is that the suite needs dev-only endpoints.This PR adds a build-time
dangerouslyEnableTestHooksoption toemdash(). Those call sites now go throughisDevOnlyEnabled(), which checksimport.meta.env.DEVor a Vitedefineset by the option. Because the value is fixed at build time, a normal build compiles the check down toreturn false;, and no env var or request can turn it on.astro buildwarns while the option is on, and only the E2E fixture sets it.The E2E side is the same as #6:
EMDASH_E2E_BUILD=productionbuilds and serves the fixture for the Node step only, with the same fixture changes for running as a built site. The shard layout is unchanged.astro dev(main)astro build --devOutput(#6)astro build+dangerouslyEnableTestHooks(this PR)#6 is the no-new-option alternative. For a full local run you also need #10. On Endform this build runs the whole suite in one job in under 6 minutes, install and build included (#9).
I used claude to help me create this PR, but I have run the suite and reviewed the code myself.
Type of change
Your connection to this change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change): core unit tests (6100 passed), full Node E2E suite against the production build (see table); core integration tests not run locallypnpm formathas been runAI assistance disclosure
Screenshots / test output
Not applicable.