Skip to content

Test: Remove final Jest infrastructure - #80999

Draft
ciampo wants to merge 4 commits into
codex/vitest-consolidated-07-tooling-cutoverfrom
codex/vitest-consolidated-08-final-cleanup
Draft

Test: Remove final Jest infrastructure#80999
ciampo wants to merge 4 commits into
codex/vitest-consolidated-07-tooling-cutoverfrom
codex/vitest-consolidated-08-final-cleanup

Conversation

@ciampo

@ciampo ciampo commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

What?

Part of #80855.

TL;DR: This is the final cleanup: it removes the retired Jest packages, configuration, dependencies, types, lint rules, migration manifest, and early Vitest probes, then adds durable project-routing and no-Jest CI invariants.

This PR is stacked on #80998 and should be reviewed after it.

Why?

Once the repository and published tooling run on Vitest, keeping two runners and transitional probes makes the supported test path ambiguous and leaves obsolete dependencies/configuration in active use.

How?

  • Removes @wordpress/jest-console, @wordpress/jest-preset-default, the private Jest configuration/reporters/transforms, and direct Jest dependencies.
  • Replaces the migration manifest with a single durable Browser Mode/jsdom/Node project map that assigns every discovered test exactly once.
  • Uses fast-glob for single-pass config-time discovery, preserving the exact inventory while avoiding repeated legacy glob scans.
  • Removes the early setup, style, console, and Browser Mode probes while retaining snapshot/serializer parity tests.
  • Adds a CI audit for Jest imports, globals, configs, commands, dependencies, types, rules, reporters, and hidden configuration files.
  • Updates active contributor guidance, VS Code launch configuration, package metadata, types, and documentation for the Vitest end state.
  • Keeps Testing Library matcher types canonical by importing the Vitest subpath from setup/global declaration files rather than listing an import subpath as a TypeScript type package.
Intentional allowlist

@testing-library/jest-dom, eslint-plugin-jest-dom, and the compatible Emotion serializer remain because they are runner-neutral. packages/report-flaky-tests remains an explicit exception because it parses legacy Jest result files; historical documentation and release fixtures are also out of scope.

Testing Instructions

  1. Run npm run test:unit:no-jest.
  2. Run npm run test:unit:conventions.
  3. Run npm run test:unit -- --run twice.
  4. Run npm run test:unit:date -- --run.
  5. Run npm run test:unit:packages and npm run lint:package-contents.
  6. Run npm run lint:js -- --quiet, npm run lint:pkg-json, and npm run lint:lockfile.
  7. Run npm run lint:published-deps.

A fresh clean complete run on the final rebased head passed all 1,001 files and 34,753 tests (8 skipped). All six timezone/locale date variants passed, and the published dependency audit reported zero findings across 130 packages.

npm run lint:deps continues to report the pre-existing yargs version split between packages/env and the rest of the repository.

Cumulative migration statistics

Measured once across the complete linear stack, from trunk merge-base 8e2fc46 through this head 7c86608, so stacked PR diffs are not double-counted:

  • 8 PRs and 44 commits change 2,633 files: 17,433 insertions and 17,741 deletions, for a net reduction of 308 lines.
  • Git detects 1,318 renames, including 1,296 .js.jsx renames.
  • The 1,001-test-file inventory is split into 9 Browser Mode, 850 jsdom, and 142 Node files. The complete local run passed 34,753 tests with 8 skipped in 208.47s.
  • 105 manifests declare vitest. Across all repository manifests, 11 direct dependency names are newly present and 17 are eliminated.
  • The lockfile graph moves from 4,128 to 3,696 package entries: 82 added and 514 removed, a net reduction of 432 entries (10.5%).
  • Two published Jest tooling workspaces are replaced one-for-one by @wordpress/vitest-console and @wordpress/vitest-preset-default.
  • The final discovery optimization reduced its initial Vitest startup from 9.73s to 1.69s (83%, or 5.8× faster), and hot watch reruns beat Jest by 29%. Final cold startup is still 88% slower than Jest and the measured CI shard wall time is 15% slower, so the migration does not claim a CI speed gain.

New direct dependency names: @flakiness/vitest, @swc/plugin-emotion, @vitejs/plugin-react-swc, @vitest/browser-playwright, @vitest/eslint-plugin, @wordpress/vitest-console, @wordpress/vitest-preset-default, jsdom, playwright, vitest, and vitest-browser-react.

Eliminated direct dependency names: @flakiness/jest, @jest/globals, @types/jest, @wordpress/jest-console, @wordpress/jest-preset-default, babel-jest, babel-plugin-transform-import-meta, eslint-plugin-jest, jest, jest-environment-jsdom, jest-environment-node, jest-jasmine2, jest-junit, jest-matcher-utils, jest-mock, jest-watch-typeahead, and snapshot-diff.

Performance comparison and acceptance

The local comparison uses the same 110-test date file, one warm-up, five single-worker process runs, and three interactive hot reruns:

  • Startup median: Jest 0.90s; final Vitest 1.69s (+0.79s, +88%).
  • Hot watch-rerun median: Jest 0.157s; Vitest 0.111s (-29%).
  • The initial final-head Vitest startup was 9.73s. The single-pass discovery fix in this PR reduced it to 1.69s without changing the 1,001-file inventory.

A contemporaneous GitHub Actions comparison of the four JavaScript shards shows a regression: the rebased predominantly-Jest boundary took 5m20s wall time, while the rebased final Vitest head took 6m09s (+49s, +15%). Both runs started together, reducing runner-load skew. All four final shards, the date matrix, and the Jest-removal/type invariants passed.

  • Explicitly accept the reported JavaScript CI wall-time regression before merge.

Testing Instructions for Keyboard

Not applicable; this PR does not change UI behavior.

Screenshots or screencast

Not applicable.

Use of AI Tools

Codex was used to implement and verify this migration PR.

@github-actions github-actions Bot added [Package] Server Side Render /packages/server-side-render [Package] Block editor /packages/block-editor [Package] E2E Tests /packages/e2e-tests [Package] Theme /packages/theme [Package] UI /packages/ui labels Jul 30, 2026
@ciampo
ciampo force-pushed the codex/vitest-consolidated-07-tooling-cutover branch from 8507291 to 0736a6c Compare July 30, 2026 23:48
@ciampo
ciampo force-pushed the codex/vitest-consolidated-08-final-cleanup branch from 06e8f75 to c03e2cb Compare July 30, 2026 23:49
@github-actions

Copy link
Copy Markdown

Size Change: 0 B

Total Size: 7.76 MB

compressed-size-action

@github-actions github-actions Bot added the [Package] Core data /packages/core-data label Jul 31, 2026
@ciampo
ciampo force-pushed the codex/vitest-consolidated-07-tooling-cutover branch from 0736a6c to 5c17b09 Compare July 31, 2026 00:38
@ciampo
ciampo force-pushed the codex/vitest-consolidated-08-final-cleanup branch from 7380e39 to 7ce2eb3 Compare July 31, 2026 00:38
@ciampo
ciampo force-pushed the codex/vitest-consolidated-07-tooling-cutover branch from 5c17b09 to 882d7e9 Compare July 31, 2026 01:12
@ciampo
ciampo force-pushed the codex/vitest-consolidated-08-final-cleanup branch from 7ce2eb3 to 71a5165 Compare July 31, 2026 01:12
@ciampo
ciampo force-pushed the codex/vitest-consolidated-07-tooling-cutover branch from 882d7e9 to e3afccd Compare July 31, 2026 01:20
@ciampo
ciampo force-pushed the codex/vitest-consolidated-08-final-cleanup branch from 3ad5f03 to db61f4f Compare July 31, 2026 01:20
@ciampo
ciampo force-pushed the codex/vitest-consolidated-07-tooling-cutover branch from e3afccd to ff264cb Compare July 31, 2026 01:39
@ciampo
ciampo force-pushed the codex/vitest-consolidated-08-final-cleanup branch from db61f4f to 26d6214 Compare July 31, 2026 01:39
@github-actions github-actions Bot removed the [Package] Core data /packages/core-data label Jul 31, 2026
@ciampo
ciampo force-pushed the codex/vitest-consolidated-07-tooling-cutover branch from ff264cb to 6788c48 Compare July 31, 2026 01:45
@ciampo
ciampo force-pushed the codex/vitest-consolidated-08-final-cleanup branch from 26d6214 to dd328ce Compare July 31, 2026 01:45
@ciampo
ciampo force-pushed the codex/vitest-consolidated-07-tooling-cutover branch from 6788c48 to 1564d5c Compare July 31, 2026 02:06
@ciampo
ciampo force-pushed the codex/vitest-consolidated-08-final-cleanup branch from dd328ce to e05a65d Compare July 31, 2026 02:07
@ciampo
ciampo force-pushed the codex/vitest-consolidated-07-tooling-cutover branch from 1564d5c to d197289 Compare July 31, 2026 02:57
@ciampo
ciampo force-pushed the codex/vitest-consolidated-08-final-cleanup branch from 92e415a to 7c86608 Compare July 31, 2026 02:57
@github-actions

Copy link
Copy Markdown

Flaky tests detected in 7c86608.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/30600328874
📝 Reported issues:

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

Labels

[Package] Block editor /packages/block-editor [Package] E2E Tests /packages/e2e-tests [Package] Server Side Render /packages/server-side-render [Package] Theme /packages/theme [Package] UI /packages/ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant