Repository navigation
docs: document running the end-to-end suite without root - #1311
Merged
Merged
Conversation
CONTRIBUTING.md gave one way to get Playwright's OS packages, npx playwright install --with-deps chromium, which shells out to apt-get install and so needs root. On an unprivileged container or shared dev host the documented recipe cannot be followed, and the failure it leaves behind (browserType.launch: Target page, context or browser has been closed) names neither the missing library nor the install step. Add the non-root path beside it: install the browser bundle alone, apt-get download the same packages into a private sysroot with a private APT state dir, dpkg-deb -x them, and point LD_LIBRARY_PATH at the result. The package list covers both binaries Playwright unpacks (the 28 chrome-headless-shell needs and the 17 more the full chrome binary loads), with an ldd loop over both as the check, and notes for the two things that look like failures but are not. tests/contributing-e2e-setup.test.mjs treated any npx playwright install without --with-deps as incomplete unless the doc also named install-deps, which needs root just the same. It now also accepts a doc that unpacks the packages into a sysroot and hands the loader that directory, and a fixture test pins that neither half alone is enough. Verified on Ubuntu 26.04 as an unprivileged user: all 45 packages download, both binaries report 0 not found under ldd, and npm run test:e2e against a production build passes (312 passed, 30 skipped). Closes #1277 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Bob Killen <bkillen@linuxfoundation.org>
This was referenced Oct 11, 2026
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.
Finding (#1277)
CONTRIBUTING.mddocumented one way to get Playwright's OS packages,npx playwright install --with-deps chromium, which runsapt-get installand so needs root. Without root the recipe cannot be followed, and the failure it leaves (browserType.launch: Target page, context or browser has been closed) names neither the missing library nor the install step. Three earlier findings (#1232, #1253, #1256) each had to note the browser suite could not be run locally for exactly this reason.What changes
CONTRIBUTING.md("End-to-end tests"): adds the non-root recipe beside the existing one. Install the browser bundle alone,apt-get downloadthe packages into a private sysroot (private APT state dir so no root is touched),dpkg-deb -xthem, and pointLD_LIBRARY_PATHat the result. The package list is the corrected one from the issue thread: the 28chrome-headless-shellneeds plus the 17 more the fullchromebinary loads, so headed andchannel: 'chromium'runs work too. Thelddcheck loops over both binaries. Notes cover the harmlessrm: cannot remove .../partialnoise, the per-shell export, not settingXDG_CACHE_HOME, and thearm64loader path. The package block is fenced withcspell:disable/enablerather than adding 40 package names to the dictionary.tests/contributing-e2e-setup.test.mjs: the contract treated anynpx playwright installwithout--with-depsas incomplete unless the doc also namedinstall-deps(which needs root just the same). It now also accepts a doc that unpacks the packages into a sysroot and hands the loader that directory (documentsSystemPackages), with a fixture test pinning that neither half alone passes. Without this change the test rejects the new section (CONTRIBUTING.md: npx playwright install chromium), so it is a genuine contract update rather than a loophole.Verification
Ran the recipe as an unprivileged user on Ubuntu 26.04 (the issue verified Debian trixie):
chromeandchrome-headless-shellreport0 missingunderldd(from 5 and 4 before);npm run build:production && npm run test:e2ewith the sysroot onLD_LIBRARY_PATH: 312 passed, 30 skipped (1.2m).tests/contributing-e2e-setup.test.mjs+tests/dev-environment.test.mjs: 20 pass.check:format,check:spelling, markdownlint onCONTRIBUTING.md: clean.Closes #1277