Skip to content

fix(reusable-ci): install Playwright browsers as the runner user, not root - #381

Merged
jdfalk merged 1 commit into
mainfrom
fix/playwright-install-user-cache
Oct 27, 2026
Merged

jdfalk merged 1 commit into
mainfrom
fix/playwright-install-user-cache

Conversation

@jdfalk

@jdfalk jdfalk commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Why

Install Playwright browsers ran sudo npx playwright install --with-deps chromium webkit, which puts the browsers in /root/.cache/ms-playwright. The E2E step then runs as runner and looks in /home/runner/.cache/ms-playwright, so every test fails at launch with browserType.launch: Executable doesn't exist at /home/runner/.cache/ms-playwright/webkit-2370/pw_run.sh. Seen on falkcorp/audiobook-organizer (all 710 tests failed in about 2 ms). The failure went unnoticed because the helper's frontend-run exits 0 on failure; that is fixed separately in falkcorp/gha-ci-workflow-helpers.

What

Split the install into two commands:

  • sudo env "PATH=$PATH" npx playwright install-deps chromium webkit: system packages need root, and env PATH keeps npx findable under sudo.
  • npx playwright install chromium webkit: browsers installed as the runner user into ~/.cache/ms-playwright, where the tests look.

Impact

Only the Install Playwright browsers step changes; it is still gated by skip-tests and skip-e2e-tests. No caller sees it until it bumps its reusable-ci pin. Once the helper fix is also in, callers whose E2E tests are really failing will go red.

Verification

actionlint is clean and the pre-commit hooks pass. Not yet run on a real runner; the first consumer that bumps its pin will exercise it.

🤖 Generated with Claude Code

https://claude.ai/code/session_011To9HQUWYYqyWHoXYmEi6Z

… root

sudo npx playwright install put browsers in /root/.cache/ms-playwright while
the E2E step runs as the runner and looks in ~/.cache, so every test failed
with 'Executable doesn't exist'. Run install-deps under sudo and install the
browsers without it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011To9HQUWYYqyWHoXYmEi6Z
@github-actions github-actions Bot added size/S github-actions GitHub Actions related work type:documentation Improvements or additions to documentation module:config Configuration management workflow:github-actions GitHub Actions workflows labels Oct 27, 2026
@jdfalk
jdfalk merged commit 1820892 into main Oct 27, 2026
42 checks passed
@jdfalk
jdfalk deleted the fix/playwright-install-user-cache branch October 27, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github-actions GitHub Actions related work module:config Configuration management size/S type:documentation Improvements or additions to documentation workflow:github-actions GitHub Actions workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant