Commit Graph
3 Commits
Author SHA1 Message Date
openhands 1dd584cd82 fix(ui): make fixture bundle browser-safe, fast and cacheable
The UI fixture bundle crashed at runtime, so every test waited out its
45s timeout:
- server-only modules leaked into the bundle and referenced node
  built-ins, the process global, and validated env at import time
- the previous platform: 'node' fix kept esbuild happy but emitted
  require() calls that cannot run in the browser

Fix it at the bundle boundary:
- alias node:* imports to e2e/ui/node-stubs.mjs (shape-compatible stubs,
  no real I/O)
- inject e2e/ui/process-shim.mjs for the process global
- define process.env.SKIP_ENV_VALIDATION=1 so src/env.ts skips parsing
  in the fixture (same escape hatch vitest uses)

Also make the fixture server fast to start:
- build JS and Tailwind CSS in parallel
- cache built assets in node_modules/.cache/nexst-ui-fixture keyed on a
  content hash of src/, fixtures, stubs and the server file
- startup drops from ~1.7s to ~220ms on cache hits
2026-10-17 17:13:59 +02:00
openhands c9b363d60d fix(ui): convert node stubs to plain JavaScript
CI / check (push) Successful in 28s
CI / tests-ui (push) Failing after 32s
CI / tests-integration (push) Successful in 1m54s
CI / tests-unit (push) Successful in 2m1s
CI / preflight (push) Skipped
CI / deploy (push) Skipped
CI / tests-imaging-browsers (push) Successful in 1m39s
CI / tests-quality (push) Successful in 48s
Biome flagged TypeScript syntax in the .mjs stub module. Remove type
annotations and prefix the unused run() store parameter with underscore
to satisfy lint rules.
2026-10-17 16:16:13 +02:00
openhands e870beb71c fix(ui): stub Node built-ins for fixture bundle
CI / check (push) Failing after 20s
CI / tests-unit (push) Skipped
CI / tests-integration (push) Skipped
CI / tests-ui (push) Skipped
CI / tests-imaging-browsers (push) Skipped
CI / tests-quality (push) Skipped
CI / preflight (push) Skipped
CI / deploy (push) Skipped
Replace platform: 'node' (incompatible with iife browser bundle) with
explicit aliases for node:async_hooks, node:crypto, node:fs/promises,
node:path pointing at e2e/ui/node-stubs.mjs. Provides shape-compatible
exports so esbuild can bundle the UI fixture without failing on Node
built-ins. Increase webServer timeout to 120s for reliable startup.
2026-10-17 16:11:52 +02:00