Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions e2e/browser-vnc.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { expect, test } from "./helpers/coverage";
import { installClawboxMocks, openLauncher } from "./helpers/clawbox";

// FIXME: passes locally / on the Jetson worktree (verified ~7-18s) but
// times out on GitHub Actions even with 60s per-test + 15s expect/action
// timeouts. Root cause is environmental (likely runner memory pressure
// with `bun run dev` under sequential workers:1). Tracked as a follow-up
// to PR #113 — needs the e2e GH-runner profile investigated separately.
// FIXME: the global-setup warmup (#114) removed the cold-compile flake, but
// this spec still times out on GitHub Actions at its first DOM interaction — a
// deeper post-mount/hydration lag under `bun run dev` workers:1 that the warmup
// doesn't touch. Passes on the Jetson; still tracked in #114.
test.fixme("browser app installs chromium, enables integration, and opens the VNC app", async ({ page }) => {
await installClawboxMocks(page, {
initialSetup: {
Expand Down
6 changes: 4 additions & 2 deletions e2e/clawkeep-interactions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@ test("restore modal opens, fetches snapshots, and Esc dismisses it", async ({ pa
await expect(modal).not.toBeVisible();
});

// FIXME: same GH-Actions-only flake as browser-vnc — verified passing
// in isolation on the Jetson. Tracked as a follow-up to PR #113.
// FIXME: the global-setup warmup (#114) removed the cold-compile flake, but
// this spec still times out on GitHub Actions at its first DOM interaction — a
// deeper post-mount/hydration lag under `bun run dev` workers:1 that the warmup
// doesn't touch. Passes on the Jetson; still tracked in #114.
test.fixme("unpair flow opens the confirm dialog and Esc dismisses it without unpairing", async ({ page }) => {
await setupDesktop(page);

Expand Down
6 changes: 4 additions & 2 deletions e2e/desktop-selection.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { expect, test } from "./helpers/coverage";
import { installClawboxMocks } from "./helpers/clawbox";

// FIXME: same GH-Actions-only flake as browser-vnc — verified passing
// in isolation on the Jetson. Tracked as a follow-up to PR #113.
// FIXME: the global-setup warmup (#114) removed the cold-compile flake, but
// this spec still times out on GitHub Actions at its first DOM interaction — a
// deeper post-mount/hydration lag under `bun run dev` workers:1 that the warmup
// doesn't touch. Passes on the Jetson; still tracked in #114.
test.fixme("desktop background context menu can launch the terminal", async ({ page }) => {
await installClawboxMocks(page, {
initialSetup: {
Expand Down
41 changes: 41 additions & 0 deletions e2e/global-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { chromium, type FullConfig } from "@playwright/test";

/**
* Warm the Turbopack dev server before the timed suite runs.
*
* CI serves e2e through `bun run dev` with `workers: 1`, so the FIRST request to
* a route pays its full on-demand Turbopack compile (route RSC + client bundle).
* Under GitHub Actions load the initial compile of `/` — the desktop shell, the
* single heaviest route — can exceed the 15s expect timeout, so whichever spec
* hits `/` first flakes on `getByTestId('desktop-root')` even though the app is
* fine (it passes on the Jetson and on every later spec once `/` is compiled).
* The same cold-compile cost also shows up as slow first interactions in the
* heavier specs. See #114.
*
* Loading the heavy routes once here, before any test starts its clock, moves
* that one-time compile out of the timed path. The dev server serves e2e with
* SESSION_SECRET unset, so middleware lets `/` through and the desktop renders
* without auth — no mocks needed just to trigger the compile.
*/
async function globalSetup(config: FullConfig) {
const baseURL = config.projects[0]?.use?.baseURL;
if (!baseURL) return;

const browser = await chromium.launch();
try {
const page = await browser.newPage({ baseURL });
// Generous budget: this call IS the cold compile we are paying up front.
await page.goto("/", { waitUntil: "networkidle", timeout: 120_000 }).catch(() => {});
// Best-effort — the compile has happened regardless of what finally renders.
await page
.getByTestId("desktop-root")
.waitFor({ state: "visible", timeout: 120_000 })
.catch(() => {});
// The setup wizard is the other heavy route tree the suite hammers.
await page.goto("/setup", { waitUntil: "networkidle", timeout: 120_000 }).catch(() => {});
} finally {
await browser.close();
}
}

export default globalSetup;
6 changes: 4 additions & 2 deletions e2e/installed-app-settings.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { expect, test } from "./helpers/coverage";
import { installClawboxMocks } from "./helpers/clawbox";

// FIXME: same GH-Actions-only flake as browser-vnc — verified passing
// in isolation on the Jetson. Tracked as a follow-up to PR #113.
// FIXME: the global-setup warmup (#114) removed the cold-compile flake, but
// this spec still times out on GitHub Actions at its first DOM interaction — a
// deeper post-mount/hydration lag under `bun run dev` workers:1 that the warmup
// doesn't touch. Passes on the Jetson; still tracked in #114.
test.fixme("installed app settings can save configuration and toggle enablement", async ({ page }) => {
await installClawboxMocks(page, {
initialSetup: {
Expand Down
6 changes: 4 additions & 2 deletions e2e/mascot-context.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { expect, test } from "./helpers/coverage";
import { installClawboxMocks } from "./helpers/clawbox";

// FIXME: same GH-Actions-only flake as browser-vnc — verified passing
// in isolation on the Jetson. Tracked as a follow-up to PR #113.
// FIXME: the global-setup warmup (#114) removed the cold-compile flake, but
// this spec still times out on GitHub Actions at its first DOM interaction — a
// deeper post-mount/hydration lag under `bun run dev` workers:1 that the warmup
// doesn't touch. Passes on the Jetson; still tracked in #114.
test.fixme("mascot tap opens the chat popup", async ({ page }) => {
await installClawboxMocks(page, {
initialSetup: {
Expand Down
7 changes: 3 additions & 4 deletions e2e/terminal-reconnect.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { expect, test } from "./helpers/coverage";
import { installClawboxMocks, openLauncher } from "./helpers/clawbox";

// FIXME: same GH-Actions-only flake as browser-vnc. The terminal
// WebSocket handshake races with the page-load timer on slow runners.
// Tracked as a follow-up to PR #113.
test.fixme("terminal can open and connect to the websocket backend", async ({ page }) => {
// Re-enabled via the global-setup warmup (see #114): the terminal WebSocket
// handshake no longer races the cold `/` compile now that it happens up front.
test("terminal can open and connect to the websocket backend", async ({ page }) => {
await page.addInitScript(() => {
const NativeWebSocket = window.WebSocket;

Expand Down
4 changes: 4 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ const baseURL = `http://localhost:${port}`;

export default defineConfig({
testDir: "./e2e",
// Pre-compile the heavy routes on the dev server before any test clock starts
// (Turbopack compiles on demand under `workers: 1`, and the cold compile of
// `/` can outlast the 15s expect timeout on CI). See #114 / global-setup.ts.
globalSetup: "./e2e/global-setup.ts",
fullyParallel: true,
forbidOnly: !!process.env.CI,
// Mirror CI's retry strategy locally too. Tests that compress
Expand Down
Loading