Repository navigation
fix(reusable-ci): install Playwright browsers as the runner user, not root - #381
Merged
Merged
Conversation
… 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Install Playwright browsersransudo npx playwright install --with-deps chromium webkit, which puts the browsers in/root/.cache/ms-playwright. The E2E step then runs asrunnerand looks in/home/runner/.cache/ms-playwright, so every test fails at launch withbrowserType.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'sfrontend-runexits 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, andenv PATHkeepsnpxfindable 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 browsersstep changes; it is still gated byskip-testsandskip-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