Skip to content

Stabilize ReadCursor E2E pipeline across local and GitHub Actions#1

Draft
RupanPrasai wants to merge 3 commits intomainfrom
codex/fix-readcursor-e2e-pipeline-on-local-and-ci
Draft

Stabilize ReadCursor E2E pipeline across local and GitHub Actions#1
RupanPrasai wants to merge 3 commits intomainfrom
codex/fix-readcursor-e2e-pipeline-on-local-and-ci

Conversation

@RupanPrasai
Copy link
Copy Markdown
Owner

Summary

This PR fixes the current E2E regressions by hardening Chrome session startup, removing brittle extension-id scraping, and adding a reliable MV3 service-worker handshake before E2E injection.

What changed

1) CI/session stability for WDIO + Chrome

  • Updated client/tests/e2e/config/wdio.browser.conf.ts to:
    • Use robust CI Chrome args (--no-sandbox, --disable-dev-shm-usage, --disable-gpu, --headless=new in CI).
    • Keep extension runs single-instance (maxInstances: 1) to avoid profile contention.
    • Use a unique --user-data-dir per run.
    • Emit debug logs for Chrome binary/version, chromedriver version, args, profile dir, unpack dir, and deterministic extension id.
    • Write WDIO logs to tests/e2e/.tmp/wdio-logs for artifact collection.

2) Deterministic extension ID (no chrome://extensions scraping)

  • Added E2E-only manifest key injection in client/chrome-extension/manifest.ts:
    • key is set only for E2E builds (version_name contains -e2e).
    • tabs permission is added only in E2E builds.
  • Replaced Chrome extension path resolver implementation in client/tests/e2e/utils/extension-path.ts:
    • It now builds chrome-extension://<deterministic-id> directly from the computed id passed by WDIO.
    • Removed all chrome://extensions DOM scraping logic.
  • In WDIO config, derive deterministic id from manifest key and wire it into browser.getExtensionPath().

3) Reliable MV3 service-worker wake/handshake

  • Added an E2E-only E2E_PING message in client/chrome-extension/src/background/index.ts.
  • Added waitForE2EBackgroundReady() retry/backoff handshake in client/tests/e2e/helpers/readcursor.ts and run it before RC_E2E_INJECT.
  • Updated blocked-page spec to use the shared injection helper so it benefits from the same handshake/retry behavior.

4) GitHub Actions E2E workflow

  • Enabled and updated .github/workflows/e2e.yml:
    • Runs on PR + manual dispatch.
    • Installs Chrome and logs browser/driver versions.
    • Builds E2E extension variant (cross-env CLI_CEB_E2E=true pnpm zip).
    • Runs only the E2E package with single concurrency.
    • Uploads E2E artifacts on failure/success (tests/e2e/.tmp/**, dist-zip/*.zip).

Why this fixes the failures

  • panel-controls.test.ts extension path breakage: removed name-based scraping entirely; extension URL is deterministic via E2E key.
  • viewport-rebuild.test.ts receiving end does not exist: test harness now waits until background SW responds before sending inject trigger.
  • GitHub Actions Chrome startup failures: stabilized Chrome launch args/profile handling and constrained extension runs to single instance while improving startup diagnostics.

Validation

  • Local command execution was attempted, but pnpm bootstrap failed in this environment due network/proxy restrictions while Corepack tried downloading pnpm@10.11.0.
  • The workflow now includes richer logs/artifacts to make CI validation and debugging deterministic.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant