Repository navigation
fix(studio): browser tests run the page runtime built from the checkout's own source - #9099
Conversation
jrusso1020
left a comment
There was a problem hiding this comment.
Reviewed at 09fb746. Requesting changes for one thing; the change itself reads right.
Blocker:
Test reachabilityis red at this head because of this PR.scripts/test-reachability.jsonpinspackages/studio/vitest.config.tsat9336af81…(main's file); the file here hashes tob4d43faa51cd0faae3c4899b5237d377df3a6d9f1848889d484a9a6c62b711c8. Re-pin that entry (and its reason text if you want it to mention the setup) and this is an approve.
Read whole: tests/buildCoreRuntime.ts, vitest.config.ts. Checked against source: core's build:hyperframes-runtime script exists and ./runtime resolves to dist/hyperframe.runtime.iife.js, the file that script writes. Nothing run locally (no install on this box); the two hashes above were computed from the files at this head and at main.
What reads right:
globalSetupsits on the browser project only, so unit runs are unchanged, and it runs once per vitest process before any browser file.- The
fails without the fix:line names a real row and the body says how it fails (stale build) and that the row still guards the long-text case.
Note, not a blocker:
- Each CI shard now rebuilds the runtime after CI's own core build. Same source, same output, about 0.3 s each.
Need: yes, local runs tested a stale build · Size: 11 lines · Reuse: core's own script · Simpler: no · Structure: fine
Risk: low once the pin is updated.
— Rames
jrusso1020
left a comment
There was a problem hiding this comment.
Reviewed at 807d1f9. Re-review of my change request at 09fb746.
My one blocker is resolved: scripts/test-reachability.json now pins packages/studio/vitest.config.ts at b4d43faa…. I recomputed the file's sha256 at this head and it matches (b4d43faa51cd0faae3c4899b5237d377df3a6d9f1848889d484a9a6c62b711c8). The reachability check and all other checks are green.
Delta: main was merged in, so I compared the PR's own diff against main at the old head and at this head. The only difference is that one pin line. tests/buildCoreRuntime.ts and the vitest.config.ts line are byte-identical to what I read whole at 09fb746.
Not run locally (no install on this box).
Need: yes, local runs tested a stale build · Size: +12 −1 · Reuse: core's own build script · Simpler: no · Structure: fine
Risk: low; test setup only.
— Rames
What
Studio's browser tests now build core's page runtime from the checkout's own source before they run. Before, they loaded whatever runtime build was already in
packages/core/dist, which can be older than the source.Why
These tests put core's page runtime into their frames (
require.resolve("@hyperframes/core/runtime"), in 20 files and fixtures). CI builds core first, so CI tests current code. A local checkout tests whatever it last built. On a machine whose build predated #9074, the sealed case "words typed after a sealed text over 200,000 characters save" timed out, because that runtime still refused text over 200,000 characters. Unsealed passed, so a local run of the sealed parity job reported that row as differing between modes, though the code had no such difference.How
tests/buildCoreRuntime.tsruns core's ownbuild:hyperframes-runtimescript (0.3 s).vitest.config.tsruns it as the browser project'sglobalSetup, once before any browser test. Unit tests are unchanged.Test plan
inlineTextTyping.browser.test.ts("words typed after a sealed text over 200,000 characters save") times out sealed, waiting 30 s, when core's runtime build predates fix(studio): a sealed preview edits text over 200,000 characters in place, as unsealed does #9074. With the fix, starting from that same old build, it passes.MAX_TEXT_MARKUPset back to 200,000 in source, the setup builds that runtime and the sealed case fails while unsealed passes.check,run unsealed,run sealed,compareandgatepass, with 38 of 40 at parity. The 200,000-character row is now at parity. The two rows not measured are edit-accuracy bench rows, which only CI runs.inlineTextTyping.browser.test.tspasses all 6 cases, 3 runs in a row in each mode.tsc --noEmit,oxlint,oxfmtand the comment ratchet are clean.No visible change
Test setup only.