Skip to content

fix(test): use preinstalled Chromium in immutable containers - #1504

Closed
BigSimmo wants to merge 3 commits into
mainfrom
codex/playwright-container-alignment
Closed

fix(test): use preinstalled Chromium in immutable containers#1504
BigSimmo wants to merge 3 commits into
mainfrom
codex/playwright-container-alignment

Conversation

@BigSimmo

@BigSimmoBigSimmo commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

Verification

  • npm run test -- tests/playwright-browser-preflight.test.ts tests/test-runner-safety.test.ts — 2 files, 37 tests passed
  • real fallback launch with a simulated older container revision — Chromium 151 launched and rendered the expected 48px element
  • npm run verify:cheap — 443 files passed; 4,631 tests passed; 3 skipped
  • identity-checked npm run ensure at http://localhost:3662, then node scripts/run-playwright.mjs tests/ui-style-contract.spec.ts --project=chromium --grep "tap-sized minimum heights survive the rendered cascade" — 1 passed (26.9s); verified server stopped afterward
  • npm run check:rag:fixtures — 36 golden cases, 23 suites passed
  • npm run check:outstanding-issues -- --base-ref origin/main
  • npm run check:branch-review-ledger
  • git diff --check origin/main...HEAD

The first broad-gate attempt exposed two missing NODE_ENV fields in test fixtures and was corrected. A subsequent 120-second wrapper timed out during the full suite and broke the reporter pipe; the same unmodified gate was rerun with the proper allowance and passed in full.

Risk and rollback

Low-to-moderate test-infrastructure risk. A download-disabled image may run an older browser than the client; the chosen path is logged and only activates when the exact managed browser is absent. Revert this PR to restore strict exact-revision failure and the manual environment override requirement.

RAG impact: no retrieval behaviour change — Playwright browser discovery and test documentation only.

Summary by CodeRabbit

  • New Features

    • Playwright-based browser runs now support compatible preinstalled Chromium browsers when downloads are disabled.
    • The newest valid browser installation is selected automatically in supported environments.
  • Bug Fixes

    • Improved browser startup reliability in containerized environments while preserving existing managed-browser behavior.
    • Unsupported or stale browser caches continue to fail safely.
  • Documentation

    • Updated testing guidance and issue records to describe the fallback behavior and validation results.
  • Tests

    • Added coverage for browser selection, download-disabled environments, and executable path configuration.

@coderabbitai

coderabbitaiBot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c08d9c99-9b45-4ec5-95a8-1fc713e6d9df

📥 Commits

Reviewing files that changed from the base of the PR and between abf7b4a and 90d5eee.

📒 Files selected for processing (7)
  • docs/branch-review-ledger.md
  • docs/outstanding-issues.md
  • docs/testing.md
  • scripts/playwright-browser-preflight.mjs
  • scripts/run-playwright.mjs
  • tests/playwright-browser-preflight.test.ts
  • tests/test-runner-safety.test.ts

📝 Walkthrough

Walkthrough

Adds a Playwright Chromium fallback for download-disabled environments. Preflight scans compatible preinstalled shells, the runner passes the selected path when managed Chromium is unavailable, tests cover precedence and safety, and documentation records issue 121 as resolved.

Changes

Playwright container fallback

Layer / File(s)Summary
Browser discovery and resolution
scripts/playwright-browser-preflight.mjs
Scans platform-specific browser layouts, prefers an existing managed shell, and selects the newest valid preinstalled shell when downloads are disabled.
Runner wiring and validation
scripts/run-playwright.mjs, tests/playwright-browser-preflight.test.ts, tests/test-runner-safety.test.ts
Propagates the detected executable path into the runner and verifies fallback selection, managed-path precedence, and download-disabled safety.
Documentation and issue records
docs/testing.md, docs/outstanding-issues.md, docs/branch-review-ledger.md
Documents the fallback constraints and records issue 121 as resolved with validation evidence.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
participant run_playwright as run-playwright.mjs
participant resolver as resolvePlaywrightBrowserExecutable
participant browsers_root as PLAYWRIGHT_BROWSERS_PATH
participant Playwright
run_playwright->>resolver: Resolve Chromium executable
resolver->>browsers_root: Scan preinstalled shells when downloads are disabled
browsers_root-->>resolver: Return newest compatible shell
resolver-->>run_playwright: Return executable path and fallback metadata
run_playwright->>Playwright: Set executable path and launch browser
Loading

Possibly related PRs

Suggested reviewers:cursoragent

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@supabase

supabaseBot commented Jul 30, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@BigSimmoBigSimmo added the skip-branch-sync Opt out of hosted pr-branch-sync / update-branch on this PR label Jul 30, 2026

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:90d5eee16e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment threadscripts/playwright-browser-preflight.mjs
@BigSimmo

Copy link
Copy Markdown
OwnerAuthor

Temporarily paused during the owner-authorized ordered merge sweep so main cannot move between exact-head review and merge. The branch and all commits are preserved; this PR will be reopened at its verified place in the queue.

@BigSimmo

Copy link
Copy Markdown
OwnerAuthor

@cursoragent this PR will be re-opened soon. Please resolve any failing CI, run bugbot and resolve any bugbot comments against current repo and fix any merge conflicts and also fix any errors and address and fix all comments or suggestions that are likely to improve the PR and Codebase. Please implement smallest required fix according to best code practices. Check your work. Leave this PR closed for now but still make all these changes and run the review. I want it ready to go for when I re-open it.

@BigSimmo

Copy link
Copy Markdown
OwnerAuthor

@cursoragent this PR will be re-opened soon. Please resolve any failing CI, run bugbot and resolve any bugbot comments against current repo and fix any merge conflicts and also fix any errors and address and fix all comments or suggestions that are likely to improve the PR and Codebase. Please implement smallest required fix according to best code practices. Check your work. Leave this PR closed for now but still make all these changes and run the review. I want it ready to go for when I re-open it.

@BigSimmo

Copy link
Copy Markdown
OwnerAuthor

@coderabbitai please run a new review of this closed PR for me

1 similar comment
@BigSimmo

Copy link
Copy Markdown
OwnerAuthor

@coderabbitai please run a new review of this closed PR for me

@coderabbitai

coderabbitaiBot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@BigSimmo: Starting a fresh review of #1504.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitaiBot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@BigSimmo: Starting a fresh review of closed PR #1504.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@BigSimmo

Copy link
Copy Markdown
OwnerAuthor

@cursoragent please reopen this pull request

@BigSimmo

Copy link
Copy Markdown
OwnerAuthor

@cursoragent why can't I open this PR

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

Labels

skip-branch-syncOpt out of hosted pr-branch-sync / update-branch on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@BigSimmo