Skip to content

improvement(desktop-e2e): one shared harness with a bounded quit, flake fixes, and a trimmed suite - #10390

Merged
waleedlatif1 merged 12 commits into
stagingfrom
improvement/desktop-e2e-harness
Nov 25, 2026
Merged

waleedlatif1 merged 12 commits into
stagingfrom
improvement/desktop-e2e-harness

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

The desktop E2E suite had 22 hand-rolled electron.launch sites, no shared teardown, and unbounded app.close() calls, so the same flake patterns kept recurring one spec at a time. This moves every spec onto one harness, fixes the remaining race patterns, and trims tests that caught nothing.

Shared harness (apps/desktop/e2e/harness.ts)

  • desktop fixture: launch / close / tempDir. It tracks every app and temp dir a test creates and tears them all down, even when the test fails midway
  • Bounded quit: ElectronApplication.close() waits for exit with no deadline, so a blocked or cancelled quit hung tests to their timeout and then hung worker teardown (the smoke afterEach failure). Now the quit gets 15s. On a stall it attaches windows, a sample of the main thread, the app's output and desktop-events.log, kills the process group, and fails the test: a stalled quit is the same path as Cmd+Q, so it's a real bug, not noise
  • Shared helpers: serve (loopback fixture server), focusFirstWindow (waits for OS focus), attachBrowserPanel (bounds follow resizes; replaces 200ms intervals), bundleSimFixture, ToolAuthorizer, and stopAndRemoveProfile, which packaged-smoke now reuses. browser-page.ts and session-fixture.ts replace per-spec copies

Flake patterns fixed across specs

  • Acting right after queued sendInputEvent without waiting for its effect: page-dialogs typing, background-executor I/I2, password-autofill
  • Clicks on windows that close themselves: smoke, password-autofill, live-sim consent
  • Steps relying on state the previous step never waited for, and polls that passed on stale state: browser-focus popups, source-connect, sign-in "nothing happened" checks, and a dialogs check that could never fail
  • Fixed sleeps replaced with conditions: background-executor journal/inbox, terminal-cancel tmux cache and recovery, quick-chat, update-notification
  • Fire-and-forget panel IPC is now followed by a round trip before acting

Cuts and merges (each deletion is covered elsewhere, or only asserted what its own fixture guaranteed)

  • background-executor G (the fixture guaranteed it); F approved/declined merged; J folded into A
  • terminal-cancel pane-id reuse test (unit-covered), plus its sleep-only halves
  • browser-tools' terminal test and duplicate confirm-dialog half; capture tests merged
  • smoke tests merged into fewer launches; one packaged launch removed
  • Unasserted screenshots everywhere
  • local-files split from one 25-step test into four, and no longer bundles apps/sim's Settings UI
  • Hand-rolled JSON report writers and check-report replaced by test.step (CI already writes Playwright's JSON report, which survives worker restarts)

Speed

  • browser-tools shares one app across its read-only tests, each with its own disposable browser scope: 40 launches become 1 shared + 5 isolated

CI

  • forbidOnly in CI
  • github reporter restored (the runner's explicit --reporter dropped failure annotations)
  • No Homebrew auto-update on the tmux install
  • A missing tmux fails CI instead of silently skipping
  • Dead SIM_DESKTOP_E2E_MAIN and *_REPORT_PATH plumbing removed

Type of Change

  • Improvement

Testing

  • bun run type-check (desktop) and biome pass
  • check:unused-exports, check:explicit-any (baseline shrunk), check:comment-hygiene, check:test-patterns, check:utils, check:file-names, check:egress-boundary and actionlint pass
  • The suite itself runs in desktop-e2e CI on this PR

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

waleedlatif1 and others added 10 commits November 24, 2026 15:49
…nd fix live-sim consent handling

local-files: four tests (consent, Full file access, fs races, restart/sign-out) on the desktop
fixture with bounded restarts; a minimal fixture page replaces apps/sim's Settings component;
the shared-prompt step waits for a real join; fs patches restore in finally and assert they ran.

desktop-tools-live-sim: launches through the harness, approves only folder consent dialogs,
and merges the two awaiting-approval tests into one launch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-in prompts onto the shared harness

- Launch, servers, fixture bundling, tool authorization, focus, and panel bounds come from the
  harness; Chromium for source-connect is Playwright's own context fixture. Report files and
  check() wrappers give way to test.step.
- browser-page.ts shares the shell fixture server, browser-chrome actions, and exact-URL page
  reads and trusted input between the dialogs and sign-in specs.
- Typed input is awaited until it lands before the next action; page lookups match the exact URL.
- Sign-in links record clicks so "nothing happened" checks only run after a click landed; the
  sign-in retry loop and the two-outcome passkey Enter check are gone; the suite is split into
  two tests so it no longer needs a longer timeout.
- source-connect waits for observable effects before asserting a stale callback, a repeated
  Connect, and the retried inventory left state alone; page errors are asserted at the end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the shared harness

Launch through the desktop fixture (launchAgainst), so every app quits under a
deadline and every profile, ZDOTDIR and temp dir is removed. Replace fixed
sleeps with condition waits (journal state, inbox reads, a tmux attachment
probe, a control run for relaunch recovery), deliver user input before the
agent acts, make tmux required in CI, and drop or merge tests other suites
already cover.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…updater and packaged specs onto the shared harness

Every spec launches through the desktop fixture with a bounded quit, binds
fixtures to loopback, and records checks as test.step. Merges duplicate
launches in smoke and continue-sign-in, folds the packaged launch-telemetry
check into the offline-page launch, replaces fixed sleeps and one-shot reads
with condition waits, and deletes the check-report file report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-parity specs onto the shared harness

Browser tools share one app across read-only tests with a disposed provisional scope per test;
window-state and sign-out tests launch their own. Fixes focus, fire-and-forget IPC, and
load races; drops unasserted screenshots, the duplicate confirm-dialog check, and the
fixture-decided terminal test.

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

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 25, 2026 12:10am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 37 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/desktop/e2e/harness.ts Resolved
Comment thread apps/desktop/e2e/session-fixture.ts Resolved
Comment thread apps/desktop/e2e/browser-page.ts Resolved
@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no new blocking issues were found.

Summary

Moves desktop E2E tests onto shared launch, cleanup, browser, and server helpers.

  • Desktop E2E tests share app setup, bounded shutdown, and waits for visible results.
  • Desktop E2E tests stop writing separate JSON check reports.
  • Desktop E2E CI blocks focused tests and keeps failure annotations visible.

Reviews (3) · Last reviewed commit: "fix(desktop-e2e): correct three migrated..." · Reviewed by Greptile

Comment thread apps/desktop/e2e/harness.ts Resolved
@blacksmith-sh

This comment has been minimized.

… per browser-tools test, quit before cleanup
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 37 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 37 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit ca57a3b into staging Nov 25, 2026
152 of 155 checks passed
@waleedlatif1
waleedlatif1 deleted the improvement/desktop-e2e-harness branch November 25, 2026 00:23
waleedlatif1 added a commit that referenced this pull request Nov 26, 2026
…ettings page again (#10432)

The #10390 migration swapped the bundled Desktop settings component for an inline stand-in, so nothing exercised the switch users get. Bundle the real component through bundleSimFixture again.

This branch was previously deployed

1 inactive deployment
Preview — 0108657a Deployed Nov 25, 2026 by vercel[bot]
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