Skip to content

Repair wp/6.4 branch Actions: Upgrade Playwright to fix Ubuntu 24.04 (Noble) browser-install failures - #140

Closed
desrosj wants to merge 1 commit into
fix-actions-6.4/ignore-browserslist-old-datafrom
fix-actions-6.4/fix-playwright-noble-install
Closed

desrosj wants to merge 1 commit into
fix-actions-6.4/ignore-browserslist-old-datafrom
fix-actions-6.4/fix-playwright-noble-install

Conversation

@desrosj

@desrosj desrosj commented Sep 1, 2026 •

Copy link
Copy Markdown
Owner

What?

Upgrades @playwright/test from 1.32.0 to 1.49.1, with the matching playwright-core dependency and @playwright/test peer dependency in packages/scripts/package.json, and regenerates package-lock.json. Also includes the three follow-up changes that version needs on this branch:

  • wp-scripts test-playwright resolves playwright-core's cli.js next to the package's main entry, instead of requiring playwright-core/cli. Ported from trunk's c1733028115 (Upgrade Playwright to 1.39.0 WordPress/gutenberg#54051).
  • skipLibCheck is added to tsconfig.base.json.
  • --skipLibCheck is added to the ad-hoc tsc call in bin/packages/check-build-type-declaration-files.js.

end2end-test.yml is unchanged: npx playwright install chromium firefox webkit --with-deps runs as before, with all three browsers.

Why?

The ubuntu-24.04 ("Noble") runner breaks npx playwright install --with-deps on Playwright versions before 1.45, which don't recognize Noble in their OS-dependency lookup. This PR previously worked around that on 1.32.0 by installing browser binaries without --with-deps and dropping WebKit, because the branch was on Node.js 16. The stack now upgrades the branch to Node.js 20, so the version can be bumped instead. 1.49.1 matches wp/6.5 (WordPress#82997) and wp/6.6 (WordPress#82926).

The workaround also left Firefox untested: on its last run, all 120 Firefox tests failed with browserContext.newPage: Page closed, starting with the first one. That's why #382 excluded Firefox. #382 is no longer part of this stack.

Each follow-up change was confirmed necessary on this branch:

  • playwright-core in @wordpress/scripts: CI runs E2E tests through wp-scripts test-playwright, which installs browsers with playwright-core. Without the bump it resolves to 1.32.0, and every shard downloads a second, unused set of 1.32.0 browsers (Chromium 112, Firefox 111, WebKit 16.4).
  • The cli.js path: newer playwright-core releases no longer export ./cli. Without this change, every Playwright shard fails with ERR_PACKAGE_PATH_NOT_EXPORTED before running a test (confirmed in CI on Validate wp/6.4 Actions: Upgrade Playwright to 1.49.1 instead of working around it #532).
  • skipLibCheck in tsconfig.base.json: Playwright 1.49.1's type declarations use Symbol.asyncDispose, which needs TypeScript 5.2; this branch uses 5.1.6. Without it, tsc --build in npm run build fails with 44 errors in node_modules/playwright-core/types/types.d.ts.
  • --skipLibCheck in check-build-type-declaration-files.js: this script runs tsc on single declaration files without reading a tsconfig. With only the tsconfig change, it still fails on e2e-test-utils-playwright's types.

skipLibCheck only skips checking declaration files, such as those under node_modules; this codebase's own sources are still type checked. trunk has the same setting.

Testing

  • Locally (Node.js 20.19.6): npm run build:packages, npm run lint:lockfile, npm run lint:tsconfig and npm run test:e2e:playwright -- --list (911 tests across all three projects) all pass.
  • In CI on the validation PR Validate wp/6.4 Actions: Upgrade Playwright to 1.49.1 instead of working around it #532: Install Playwright dependencies succeeded on all 4 shards. --with-deps installed the Noble packages (libasound2t64, libsoup-3.0-0, libvpx9), all three browsers downloaded, and wp-env start succeeded. The tests themselves didn't run there because of the cli.js path issue, which this PR now fixes.

Test failures caused by the jump from 1.32 to 1.49 are handled in the PRs above this one in the stack.

Use of AI Tools

This PR was created by Claude Code under my supervision. All code should be treated as AI-produced and not yet reviewed by a human until this PR is marked Ready for Review.

🤖 Generated with Claude Code

@desrosj
desrosj removed this pull request from stack #114 September 10, 2026 19:34
@desrosj
desrosj force-pushed the fix-actions-6.4/fix-playwright-noble-install branch from 61f2869 to d62789f Compare September 10, 2026 19:37
@desrosj
desrosj added this pull request to stack #188 September 10, 2026 19:37
@desrosj
desrosj force-pushed the fix-actions-6.4/fix-playwright-noble-install branch from d62789f to f732740 Compare September 11, 2026 00:02
@desrosj
desrosj force-pushed the fix-actions-6.4/fix-playwright-noble-install branch from f732740 to a1e2941 Compare September 11, 2026 00:29
@desrosj
desrosj force-pushed the fix-actions-6.4/fix-playwright-noble-install branch from a1e2941 to 02a8075 Compare September 11, 2026 01:14
@desrosj
desrosj force-pushed the fix-actions-6.4/fix-playwright-noble-install branch from 02a8075 to 319ad23 Compare September 11, 2026 02:19
@desrosj
desrosj force-pushed the fix-actions-6.4/fix-playwright-noble-install branch from 319ad23 to b0577d3 Compare September 11, 2026 02:29
@desrosj
desrosj force-pushed the fix-actions-6.4/fix-playwright-noble-install branch from b0577d3 to c540c1e Compare September 11, 2026 16:08
desrosj added a commit that referenced this pull request Sep 12, 2026
`packages/env` still shelled out to a literal `docker-compose` binary
(Docker Compose V1, standalone), which GitHub's current runner images
no longer ship. Every `wp-env` command — including `wp-env start`,
which every Puppeteer, Playwright, and PHP job on this branch depends
on — failed immediately with `Error: spawn docker-compose ENOENT`.

Docker Compose V2 ships as a `docker compose` subcommand rather than a
separate binary, and the `docker-compose` npm package (which this
package uses to drive it) only exposes a V2-compatible API via its
`v2` export starting at `0.23.x`. This bumps the dependency to
`^0.24.3` and switches every call site to `require( 'docker-compose' ).v2`,
and updates `run.js`'s direct CLI invocation from the `docker-compose`
binary to `docker compose`.

This is the same fix WordPress#51339 ("wp-env: Migrate to
Compose V2") applied to trunk in December 2023
(a0943f2), fixing
WordPress#51249. This branch's own
`fix-actions-6.4/fix-playwright-noble-install` (#140) already
documented this exact failure as a known, separate, out-of-scope
issue left for future work — this is that work.

`docker-compose@0.24.3` pulls in `yaml@^2.2.2` as a new transitive
dependency, and that package ships as ESM. Jest's default
`transformIgnorePatterns` excludes `node_modules` from transformation,
so any test that ends up requiring `packages/env` (directly or via
`docker-compose`) fails with a syntax error when Jest hits `yaml`'s
ESM `export`/`import` statements. `test/unit/jest.config.js` now
allow-lists `docker-compose` and `yaml` so Jest transforms them like
project source instead of skipping them.
@desrosj
desrosj removed this pull request from stack #188 September 13, 2026 00:46
@desrosj
desrosj added this pull request to stack #312 September 13, 2026 00:46
@desrosj
desrosj force-pushed the fix-actions-6.4/fix-playwright-noble-install branch from c540c1e to b7d36d2 Compare September 13, 2026 02:57
@desrosj
desrosj force-pushed the fix-actions-6.4/fix-playwright-noble-install branch from b7d36d2 to 6ca8616 Compare September 14, 2026 01:38
@desrosj
desrosj force-pushed the fix-actions-6.4/fix-playwright-noble-install branch from 6ca8616 to fe810c3 Compare September 14, 2026 17:38
@desrosj
desrosj added this pull request to stack #432 September 21, 2026 23:24
@desrosj
desrosj removed this pull request from stack #432 September 21, 2026 23:49
@desrosj
desrosj changed the base branch from fix-actions-6.4/disable-flaky-test-issue-reporting to wp/6.4 September 21, 2026 23:50
@desrosj
desrosj force-pushed the fix-actions-6.4/fix-playwright-noble-install branch from e901ee6 to 324f286 Compare September 21, 2026 23:51
@desrosj
desrosj changed the base branch from wp/6.4 to fix-actions-6.4/disable-flaky-test-issue-reporting September 21, 2026 23:52
@desrosj
desrosj added this pull request to stack #440 September 21, 2026 23:54
@desrosj
desrosj removed this pull request from stack #440 September 22, 2026 15:39
@desrosj
desrosj changed the base branch from fix-actions-6.4/disable-flaky-test-issue-reporting to wp/6.4 September 22, 2026 15:39
@desrosj
desrosj force-pushed the fix-actions-6.4/fix-playwright-noble-install branch from 324f286 to 6210123 Compare September 22, 2026 15:44
@desrosj
desrosj changed the base branch from wp/6.4 to fix-actions-6.4/ignore-browserslist-old-data September 22, 2026 15:44
@desrosj
desrosj added this pull request to stack #458 September 22, 2026 15:44
@desrosj
desrosj removed this pull request from stack #458 September 22, 2026 20:15
@desrosj
desrosj changed the base branch from fix-actions-6.4/ignore-browserslist-old-data to wp/6.4 September 22, 2026 20:16
@desrosj
desrosj force-pushed the fix-actions-6.4/fix-playwright-noble-install branch from 6210123 to b935f21 Compare September 22, 2026 21:32
@desrosj
desrosj changed the base branch from wp/6.4 to fix-actions-6.4/ignore-browserslist-old-data September 22, 2026 21:34
@desrosj
desrosj added this pull request to stack #482 September 22, 2026 21:34
@desrosj
desrosj removed this pull request from stack #482 September 23, 2026 01:30
@desrosj
desrosj changed the base branch from fix-actions-6.4/ignore-browserslist-old-data to wp/6.4 September 23, 2026 01:30
@desrosj
desrosj force-pushed the fix-actions-6.4/fix-playwright-noble-install branch from b935f21 to ab9e88c Compare September 23, 2026 01:36
@desrosj
desrosj changed the base branch from wp/6.4 to fix-actions-6.4/ignore-browserslist-old-data September 23, 2026 01:38
@desrosj
desrosj added this pull request to stack #485 September 23, 2026 01:38
@desrosj
desrosj removed this pull request from stack #485 September 24, 2026 04:44
@desrosj
desrosj changed the base branch from fix-actions-6.4/ignore-browserslist-old-data to wp/6.4 September 24, 2026 04:45
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: desrosj <desrosj@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

GitHub's `ubuntu-24.04` ("Noble") runners break `npx playwright install --with-deps` on Playwright versions before `1.45`, which don't recognize Noble in their OS-dependency lookup. `1.49.1` matches the version already used on `wp/6.5` and newer branches, and is compatible with this branch's Node.js 20.

`playwright-core` in `@wordpress/scripts` is bumped in lockstep, because `wp-scripts test-playwright` downloads browsers through it. Leaving it at `1.32.0` would download a second, unused set of `1.32.0` browser builds on every E2E run.

`wp-scripts test-playwright` now resolves `playwright-core`'s `cli.js` next to the package's main entry, instead of requiring `playwright-core/cli`. Newer `playwright-core` releases no longer export that subpath, so the old call fails with `ERR_PACKAGE_PATH_NOT_EXPORTED` before any test runs. Ported from `trunk`'s `c1733028115` ("Upgrade Playwright to 1.39.0", WordPress#54051).

`skipLibCheck` is added to `tsconfig.base.json` and to the ad-hoc `tsc` call in `check-build-type-declaration-files.js`, which does not read a tsconfig file. Playwright `1.49.1`'s type declarations use `Symbol.asyncDispose` (TypeScript's `esnext.disposable` lib, added in TypeScript 5.2), and this branch is pinned to TypeScript `5.1.6`. Without both, `npm run build` fails in `build:package-types`. The setting only skips checking of declaration files, such as those under `node_modules`; this codebase's own sources are still type checked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@desrosj

desrosj commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

Moved to WordPress#83685. The branch is left in place.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant