ReviewOS

home-lang/home

Make spawned Bun HTML dev server reachable in Svelte corpus test

#641
Closed chris opened this 10 days ago ·
10 days ago

Problem

After reproducible corpus dependency provisioning is fixed by #618, the unchanged integration/svelte/client-side.test.ts reaches both tests. Home successfully imports bun-plugin-svelte and bundles the Svelte entrypoint, but the spawned Bun HTML dev server is not listening when the test fetches http://localhost:3000, so fetch reports ConnectionRefused.

Pinned Bun 4982b91 passes both tests and serves the generated page. Home passes the bundling test and fails only the dev-server request in both Debug and ReleaseFast.

Reproduction

scripts/provision-corpus-deps.sh
HOME_NATIVE_VM=1 HOME_CORPUS_FULL_VM=1 ./zig-out/bin/home test packages/runtime/test/bun-corpus/integration/svelte/client-side.test.ts

Home: 1 pass / 1 fail. Pinned Bun: 2 pass / 0 fail.

Acceptance criteria

  • The child launched through the unchanged bunExe and Bun.spawn path starts the HTML dev server on port 3000.
  • The unchanged response status and content-type assertions pass in Debug and ReleaseFast.
  • Preserve the upstream 500 ms startup window and real child/server workload.
  • No retry loops, longer sleeps, fixture rewrites, replacement server, or relaxed assertion.

Related: #66 and #618.

10 days ago

Fixed by f2b5792.

Home now:

  • classifies configured HTML loaders before VM entry evaluation, so the internal HTML bootstrap imports the bundle and starts Bun.serve instead of exiting successfully as a no-op;
  • recognizes .html as a runtime entrypoint for both implicit and explicit run forms;
  • boots HTML through the native full VM even without the temporary HOME_NATIVE_VM gate.

Verification used the unchanged upstream corpus and its unchanged 500 ms startup wait:

  • Debug build: passed.
  • ReleaseFast build: passed.
  • integration/svelte/client-side.test.ts on Debug: 2 pass, 0 fail, 4 assertions.
  • The same file on ReleaseFast: 2 pass, 0 fail, 4 assertions.
  • Direct ungated home index.html --port=34568 returned HTTP 200 with Content-Type text/html.
  • Runtime units: 1,824 passed, 19 existing skips, 0 failed.
  • Focused CLI extension unit: passed.

No fixture, timeout, retry, replacement server, or assertion changes were made.

Sign in to comment on this issue.