Skip to content

test: serve the browser fixtures from a production build - #490

Merged
kgoedecke merged 1 commit into
mainfrom
kgoedecke/built-test-fixtures
Nov 10, 2026
Merged

kgoedecke merged 1 commit into
mainfrom
kgoedecke/built-test-fixtures

Conversation

@kgoedecke

Copy link
Copy Markdown
Collaborator

Stacked on the drawing test split.

Why

Every browser test loaded its fixture from a Vite dev server: several hundred unbundled modules, a second or two per load on a CI runner. That dev server's live-reload client is also what turned one stalled page load into a 40-test cascade on 9 November.

What changes

  • tests/globalSetup.ts builds every fixture page plus index.html once per run (tests/fixtures.vite.config.ts) into a temp directory and serves it with vite preview. One mode for local and CI; there is no dev server any more.
  • The build runs as its own vite build process, since a production build needs NODE_ENV=production and vitest has already set it to test.
  • The three files that put the app in front of a real backend (zoomToolBrowser, pageControlsBrowser, fitSelectionBrowser) use serveBuilt(proxy) over the same build.
  • Two tests depended on dev-server paths: elementCommentPositionBrowser imported /src/lib/store.ts from the page (the fixture now exposes the store), and frameReplay matched the recorder by /dist/recorder.js (it now checks the real request's path, so the assertion is not vacuous).

Measurements (two-CPU Linux container)

Before After
All browser tests 444s 235s
elementPanelBrowser alone 122s 55s
The fixture build itself (on a Mac) n/a 0.6–1.1s

Limits

  • A run that touches no browser test still pays for the build and the Chromium launch.
  • The fixtures are built minified, as the app ships, so a page error's stack is not readable source.
  • The mupdf .wasm is emitted into the build, but no browser test loads it, so that path is unexercised.

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Browser tests now load one production build instead of using Vite’s dev server.

  • Browser tests load fixture pages from one production build.
  • Backend-backed browser tests run through the built app.
  • The comment-position test seeds state through its built fixture.
  • Replay tests find the recorder in the production bundle.

No actionable issues were found. Tests were not run.

Reviews (2) · Last reviewed commit: "test: serve the browser fixtures from a ..." · Reviewed by Greptile

@kgoedecke
kgoedecke force-pushed the kgoedecke/split-drawing-tests branch from 9919313 to 950c3d8 Compare November 10, 2026 09:29
@kgoedecke
kgoedecke force-pushed the kgoedecke/built-test-fixtures branch 2 times, most recently from ac8c403 to b6a1058 Compare November 10, 2026 09:38
@kgoedecke
kgoedecke force-pushed the kgoedecke/split-drawing-tests branch 2 times, most recently from 1f0b96f to 231dcf9 Compare November 10, 2026 09:40
@kgoedecke
kgoedecke force-pushed the kgoedecke/built-test-fixtures branch from b6a1058 to 4eddddd Compare November 10, 2026 09:40
@kgoedecke
kgoedecke force-pushed the kgoedecke/split-drawing-tests branch from 231dcf9 to 761cab7 Compare November 10, 2026 10:27
@kgoedecke
kgoedecke force-pushed the kgoedecke/built-test-fixtures branch from 4eddddd to 67bc94f Compare November 10, 2026 10:27
Every browser test opens its own page, and each load from the Vite dev
server fetched several hundred unbundled modules: a second or two on a
CI runner, and a stalled load left the dev client polling for a server
it thought lost.

The run now builds the fixtures and the app once
(tests/fixtures.vite.config.ts, its own vite process so NODE_ENV can be
production, about a second) into a temp directory and serves it with
vite preview. There is one mode, local and CI alike, and no dev server.
The three files that put the app in front of a real backend serve the
same build with their proxy through serveBuilt().

Two tests leaned on the dev server. The comment pin test now reads the
store from the fixture instead of importing /src from the page, and the
replay tests match the recorder's built file name and assert that the
saved HTML does not carry that exact URL.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@kgoedecke
kgoedecke force-pushed the kgoedecke/built-test-fixtures branch from 67bc94f to f6b144c Compare November 10, 2026 10:34
@kgoedecke
kgoedecke changed the base branch from kgoedecke/split-drawing-tests to main November 10, 2026 10:34
@kgoedecke

Copy link
Copy Markdown
Collaborator Author

@greptileai

@kgoedecke
kgoedecke merged commit 98975e2 into main Nov 10, 2026
11 checks passed
@kgoedecke
kgoedecke deleted the kgoedecke/built-test-fixtures branch November 10, 2026 10:50
kgoedecke added a commit that referenced this pull request Nov 16, 2026
* feat(shell): suggest the native app from the browser

A computer's browser gets a desktop-app card at the foot of the rail
(Download for macOS / Windows / Linux, dismissed for good); an iPhone or
iPad gets a bottom sheet pointing at the App Store (snoozed 14 days),
on Home and the canvas, held while the onboarding questions are open.
Nothing shows inside the desktop app, on Android or on ChromeOS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(shell): hold the iOS sheet until onboarding is settled, drop the grab handle

useOnboardingAsk now reports `pending` while the account or its answers
are loading (a failed check settles as not asked), so the App Store sheet
no longer opens, hides under the questionnaire and opens again on a slow
connection. The sheet's grab handle implied a swipe the Radix sheet does
not have, so it is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 1cd31f6a9e32d364510129953ed85db34a9b0a87)
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