Skip to content

Tests: Isolate deprecation warning state - #83107

Merged
ciampo merged 3 commits into
trunkfrom
codex/vitest-order-data-deprecation
Sep 24, 2026
Merged

ciampo merged 3 commits into
trunkfrom
codex/vitest-order-data-deprecation

Conversation

@ciampo

@ciampo ciampo commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Follow up to #80855.

What?

Isolate deprecation warning state in tests across data, block-editor, components, compose, and interface, and document the patterns in @wordpress/deprecated.

Why?

Deprecation messages are logged once. With shuffle seed 80856, an earlier registry test consumed the registerGenericStore warning before the test that expected it. Several other suites also cleared unrelated deprecation state or left their own messages behind.

How?

The registry suite suppresses its expected deprecation except when asserting the warning. Other suites clear only their own messages before and after tests, preserve warning assertions, and check exact text where applicable. Remove obsolete cleanup from the font-size utility tests and add README examples for both patterns.

Testing Instructions

Run the affected suites with shuffled files and tests. All warning assertions and behavior checks should pass regardless of execution order.

npm run test:unit -- --sequence.shuffle.files --sequence.shuffle.tests --sequence.seed=80856 \
  packages/data/src/test/registry.js \
  packages/interface/src/store/test/actions.ts \
  packages/compose/src/higher-order/pure/test/index.jsdom.test.jsx \
  packages/block-editor/src/components/font-sizes/test/utils.js \
  packages/block-editor/src/components/font-sizes/test/fluid-utils.js \
  packages/block-editor/src/store/test/selectors.jsdom.test.jsx \
  packages/components/src/form-token-field/test/index.jsdom.test.tsx \
  packages/components/src/circular-option-picker/test/index.browser.test.tsx

Testing Instructions for Keyboard

Not applicable; this changes tests and documentation only.

Verification

All 341 affected tests passed with seed 80856, including 11 Chromium tests. Type checking, the full build, documentation generation, and commit hooks passed. JavaScript lint reported no errors and existing assertion warnings. Markdown lint reports three existing issues in the README's autogenerated API section.

Use of AI Tools

Codex helped reproduce the seeded failure, implement and document the cleanup, investigate CI, and run verification.

@github-actions github-actions Bot added the [Package] Data /packages/data label Sep 17, 2026
@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

📦 Bundle size

Size Change: 0 B

Total Size: 8.22 MB

06aed5a Run

@ciampo ciampo added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Sep 22, 2026
@ciampo
ciampo changed the base branch from codex/vitest-order-cover-toolbar to codex/vitest-order-fixtures September 22, 2026 14:39
@ciampo
ciampo force-pushed the codex/vitest-order-fixtures branch from 0dda13d to d903469 Compare September 24, 2026 10:18
@ciampo
ciampo force-pushed the codex/vitest-order-data-deprecation branch from 570f196 to 2655c4a Compare September 24, 2026 10:21
@ciampo
ciampo force-pushed the codex/vitest-order-fixtures branch from d903469 to b2c7cd3 Compare September 24, 2026 10:39
@ciampo
ciampo force-pushed the codex/vitest-order-data-deprecation branch from 2655c4a to 490c254 Compare September 24, 2026 10:41
@ciampo
ciampo force-pushed the codex/vitest-order-data-deprecation branch from 490c254 to ac636f8 Compare September 24, 2026 14:47
@ciampo
ciampo changed the base branch from codex/vitest-order-fixtures to trunk September 24, 2026 14:47
@ciampo
ciampo force-pushed the codex/vitest-order-fixtures branch from b2c7cd3 to 829bb05 Compare September 24, 2026 14:47
@ciampo ciampo self-assigned this Sep 24, 2026
@ciampo
ciampo marked this pull request as ready for review September 24, 2026 14:47
@ciampo
ciampo requested a review from Mamaduka as a code owner September 24, 2026 14:47
@github-actions

github-actions Bot commented Sep 24, 2026 •

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: ciampo <mciampini@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

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

@Mamaduka Mamaduka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should add something about unit testing deprecations to the package's README file.

@github-actions github-actions Bot added the [Package] Deprecated packages/deprecated label Sep 24, 2026

<!-- END TOKEN(Autogenerated API docs) -->

## Unit testing deprecations

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mamaduka hope this looks good!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 🎉

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll actually apply this guidance elsewhere in the repo in this PR, while I'm at it.

@ciampo
ciampo requested review from a team and ellatrix as code owners September 24, 2026 15:13
@github-actions github-actions Bot added [Package] Compose /packages/compose [Package] Components /packages/components [Package] Block editor /packages/block-editor [Package] Interface /packages/interface labels Sep 24, 2026
@ciampo ciampo added the [Type] Developer Documentation Documentation for developers label Sep 24, 2026
@ciampo ciampo changed the title Data: Isolate registerGenericStore warning tests Tests: Isolate deprecation warning state Sep 24, 2026
@ciampo ciampo removed the [Type] Developer Documentation Documentation for developers label Sep 24, 2026
@ciampo
ciampo enabled auto-merge (squash) September 24, 2026 15:15
@ciampo
ciampo merged commit 1b2107b into trunk Sep 24, 2026
73 of 74 checks passed
@ciampo
ciampo deleted the codex/vitest-order-data-deprecation branch September 24, 2026 15:29
@github-actions github-actions Bot added this to the Gutenberg 24.2 milestone Sep 24, 2026
widoz pushed a commit to widoz/gutenberg that referenced this pull request Oct 2, 2026
* Data: Isolate registerGenericStore warning tests

* Deprecated: Document unit testing deprecation warnings

* Tests: Scope deprecation cleanup to each suite

---

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
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] Components /packages/components [Package] Compose /packages/compose [Package] Data /packages/data [Package] Deprecated packages/deprecated [Package] Interface /packages/interface [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants