Skip to content

test(app): make open-in-browser DOM fixture hermetic for the Coverage gate - #1293

Merged
yzxoi merged 1 commit into
devfrom
fix/app-open-in-browser-vite-fixture
Aug 31, 2026
Merged

test(app): make open-in-browser DOM fixture hermetic for the Coverage gate#1293
yzxoi merged 1 commit into
devfrom
fix/app-open-in-browser-vite-fixture

Conversation

@yzxoi

@yzxoi yzxoi commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the red Coverage gate on dev (and the failing All checks passed summary job). The file-workbench open-in-browser DOM suite added in #1290 fails in the ci-coverage job: its Vite fixture can't resolve @ericsanchezok/synergy-plugin/theme (the plugin exports map serves import from gitignored dist/theme/index.js, and the Coverage job runs no build step), and the real Lingui runtime pulls @messageformat/parser (CJS) whose named parse import breaks under Vite's dependency pre-bundling. The page 500s and every case times out after 30s (ECONNREFUSED in the gate's failure signals), which also zeroes packages/app coverage.

Ports the mitigations ThemePicker.behavior.test.tsx already accumulated (e7fbc3974, 43c4905ad, cd63660e5) to this fixture:

  • Alias @ericsanchezok/synergy-plugin/theme to its source entry
  • Stub the Lingui runtime (@lingui/solid, @lingui/core) since the suite asserts chrome/click behavior, not i18n rendering
  • Pre-bundle the Solid runtime + zod with optimizeDeps.include + noDiscovery: true
  • Scope cacheDir to the fixture temp dir so sibling Playwright servers don't invalidate each other's optimizer cache
  • warmupRequest the fixture before the browser connects; surface page/console/HTTP errors instead of bare selector timeouts
  • Register the suite in playwrightIsolated in packages/app/script/test.ts

Adds a decision record (docs/decisions/implemented/testing/2026-08-31-hermetic-vite-fixtures-for-playwright-dom-tests.md) and codifies the hermetic-Vite-fixture checklist in the testing-guide skill so future Playwright DOM fixtures get the mitigations up front.

Verification

  • bun test --timeout 120000 test/components/file-workbench/open-in-browser.dom.test.ts — 3/3 pass (~7s total)
  • Regression: ThemePicker, pdf-preview, selection suites — 8/8 pass
  • bun run decision:check, bun run skill:check, staged lint — pass
  • Verified with plugin dist/ absent (same condition as the Coverage job)

… gate

The file-workbench open-in-browser suite (#1290) failed the ci-coverage
gate: its Vite fixture could not resolve @ericsanchezok/synergy-plugin/theme
(the exports map serves import from gitignored dist/) and the real Lingui
runtime pulls @messageformat/parser (CJS) whose named import breaks under
dependency pre-bundling, so the page 500'd and every case timed out.

Port the ThemePicker fixture mitigations: alias plugin theme to source,
stub the Lingui runtime, pre-bundle the Solid runtime with noDiscovery,
scope the optimizer cache to the fixture, warm the module graph before
the browser connects, surface page/console/HTTP errors, and register the
suite in playwrightIsolated so worker reaping cannot kill Chromium.

Co-authored-by: synergy-agent <299070056+synergy-agent@users.noreply.github.com>
@yzxoi
yzxoi merged commit 8f875b3 into dev Aug 31, 2026
11 checks passed
@yzxoi
yzxoi deleted the fix/app-open-in-browser-vite-fixture branch August 31, 2026 14:54
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