Skip to content

browser-test: embed-static env -- test the built editor.embed.html ar…#1892

Open
jpolitz wants to merge 1 commit into
brownplt:drydockfrom
jpolitz:embed-static-tests
Open

browser-test: embed-static env -- test the built editor.embed.html ar…#1892
jpolitz wants to merge 1 commit into
brownplt:drydockfrom
jpolitz:embed-static-tests

Conversation

@jpolitz

@jpolitz jpolitz commented Jul 14, 2026

Copy link
Copy Markdown
Member

…tifact

Joe says:

Completing the set of environments under headless test. We now have:

  • Plain HTML/self-host embedded (e.g. the pyret-embed npm package)

In addition to:

  • Server-direct-served (e.g. code.pyret.org/editor)
  • Server-iframe-embedded (e.g. the VMT use case)
  • VScode-in-browser
  • VScode-in-browser with a GitLab-simulating server that breaks various things

--env=embed drives /editor#controlled=true through a running CPO server, so the file an embedding host actually deploys -- editor.embed.html, rendered once at build time from src/web/editor.html + .env.embed (BASE_URL=".", relative asset paths, POSTMESSAGE_ORIGIN="*") -- was never loaded by any test.

embed-static serves code.pyret.org/build/web from a plain correct-MIME static server (new shared/static-server.js: multi-root + path aliases), aliases /editor to /editor.embed.html, and loads the same test-util/embed/embed1.html host page the embed env uses -- so the embed flow is byte-for-byte the existing one, but every asset comes from the built artifact. Catches breakage only visible there: template variables mis-rendered at build time, and asset references that resolve at a server root but 404 under relative/static hosting (the bug class of 21dbeb9).

Strictly additive: nothing under code.pyret.org/ changes. In CI it's a fifth matrix entry needing only the cpo-build artifact -- no CPO server, no code.pyret.org node_modules (those steps now run for cpo|embed only).

Verified locally: all five suites (check-blocks, errors, type-check, charts, tables) pass against the static artifact -- 236 tests, 0 failures.

…tifact

Joe says:

Completing the set of environments under headless test. We now have:

- Plain HTML/self-host embedded (e.g. the pyret-embed npm package)

In addition to:

- Server-direct-served (e.g. code.pyret.org/editor)
- Server-iframe-embedded (e.g. the VMT use case)
- VScode-in-browser
- VScode-in-browser with a GitLab-simulating server that breaks various things

--env=embed drives /editor#controlled=true through a running CPO server,
so the file an embedding host actually deploys -- editor.embed.html,
rendered once at build time from src/web/editor.html + .env.embed
(BASE_URL=".", relative asset paths, POSTMESSAGE_ORIGIN="*") -- was never
loaded by any test.

embed-static serves code.pyret.org/build/web from a plain correct-MIME
static server (new shared/static-server.js: multi-root + path aliases),
aliases /editor to /editor.embed.html, and loads the same
test-util/embed/embed1.html host page the embed env uses -- so the embed
flow is byte-for-byte the existing one, but every asset comes from the
built artifact. Catches breakage only visible there: template variables
mis-rendered at build time, and asset references that resolve at a
server root but 404 under relative/static hosting (the bug class of
21dbeb9).

Strictly additive: nothing under code.pyret.org/ changes. In CI it's a
fifth matrix entry needing only the cpo-build artifact -- no CPO server,
no code.pyret.org node_modules (those steps now run for cpo|embed only).

Verified locally: all five suites (check-blocks, errors, type-check,
charts, tables) pass against the static artifact -- 236 tests, 0
failures.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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