#66035 closed enhancement (fixed)
E2E workflow installs Playwright browsers and deps that no test uses
| Reported by: | adrianmoldovanwp | Owned by: | lancewillett |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.2 |
| Component: | Build/Test Tools | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | tests |
Description
The end-to-end tests workflow does two pieces of Playwright setup that nothing uses.
The browser install runs twice
.github/workflows/reusable-end-to-end-tests.yml installs Chromium:
npm exec --no -- playwright install --with-deps chromium
The test step then runs npm run test:e2e, which is wp-scripts test-playwright. Before it starts the tests, that script runs playwright install with no browser argument:
if ( ! getAsBooleanFromENV( 'PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD' ) ) { const result = spawn( 'npx', [ 'playwright', 'install' ], { stdio: 'inherit', } ); }
(@wordpress/scripts 33.0.0, scripts/test-playwright.js)
With no argument, playwright install installs Chromium, Firefox, and WebKit. The earlier step already cached Chromium, so each job downloads Firefox and WebKit and then never opens them.
Nothing in the repository runs on those two browsers. Every Playwright config under tests/ spreads the @wordpress/scripts base config, which declares one project:
projects: [ { name: 'chromium', use: { ...devices[ 'Desktop Chrome' ] } } ]
--with-deps installs only fonts
On ubuntu-24.04, every shared library Chromium needs reports already the newest version. The flag installs nine packages, and all nine are fonts: fonts-ipafont-gothic, fonts-freefont-ttf, fonts-tlwg-loma-otf, fonts-unifont, fonts-wqy-zenhei, xfonts-encodings, xfonts-utils, xfonts-cyrillic, xfonts-scalable.
Those fonts cover CJK, Thai, Cyrillic, and the X core fonts. No spec in tests/e2e uses those scripts, the workflow installs only de_DE, and no spec asserts on a screenshot.
Proposed change
Set PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD on the test step, and drop --with-deps from the install step.
Change History (4)
This ticket was mentioned in PR #13369 on WordPress/wordpress-develop by @adrianmoldovanwp.
2 months ago
#1
- Keywords has-patch added
@ugyensupport commented on PR #13369:
2 months ago
#2
Verified: reviewed the workflow diff and confirmed the gating logic (PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD is only set when install-playwright is true, so the fallback path for install-playwright: false callers is unaffected). Checked the PR's own CI run (#62141) directly: all 16 checks pass, both E2E matrix jobs succeed with 27/27 tests (26 passed + 1 flaky-then-passed) in each job, matching the trunk baseline count — confirming no coverage is lost by dropping --with-deps and skipping the redundant Firefox/WebKit download. LGTM.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Trac ticket: https://core.trac.wordpress.org/ticket/66035
The E2E workflow does two pieces of Playwright setup that nothing uses.
A second browser install.
wp-scripts test-playwrightrunsnpx playwright installwith no browser argument, which installs Chromium, Firefox, and WebKit. An earlier step already installed Chromium, so every job downloads Firefox and WebKit and never opens them. SettingPLAYWRIGHT_SKIP_BROWSER_DOWNLOADon theRun E2E testsstep makeswp-scriptsskip it.--with-deps. Onubuntu-24.04, every shared library Chromium needs reportsalready the newest version. The flag installs nine font packages instead, covering CJK, Thai, Cyrillic, and the X core fonts. No spec intests/e2euses those scripts, the workflow installs onlyde_DE, and no spec asserts on a screenshot.Before, on trunk run 33649288756:
After, on run 33661004598 for this branch: none of those lines appear, Chromium and the headless shell still install, and both jobs pass 27 tests, the same count as the trunk run. Each job finished about a minute sooner. A single pair of runs makes that figure noisy; the removed work accounts for roughly 36 seconds of it.
## Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: Reviewing these changes against the CI job logs and the
@wordpress/scriptssource.