Skip to content

Tests: Improve theme test isolation - #13194

Open
sirreal wants to merge 2 commits into
WordPress:trunkfrom
sirreal:agent/test-order-themes-isolation
Open

Tests: Improve theme test isolation#13194
sirreal wants to merge 2 commits into
WordPress:trunkfrom
sirreal:agent/test-order-themes-isolation

Conversation

@sirreal

@sirreal sirreal commented Aug 20, 2026

Copy link
Copy Markdown
Member

Summary

  • Uses a genuinely unregistered block fixture for negative global-style assertions and restores theme support, stylesheet, filter, and theme-JSON cache state.
  • Keeps the changes confined to PHPUnit tests and fixtures.

Verification

  • 100 consecutive fresh randomized themes-group runs passed on the final combined campaign head; each completed 625 tests and 7,297 assertions.
  • Exact seeds 1789044001 through 1789044100 all completed within the 30-second hard bound.
  • The final gate also covered the non-querying locale restoration carried by the l10n PR; the theme fixture changes had already passed the original 50-run isolated gate.
  • Replayed the original failing seed and focused contaminator/consumer cases during diagnosis.
  • PHP syntax checks passed for every changed PHP file.
  • git diff --check passed.

Trac: https://core.trac.wordpress.org/ticket/65893

@lancewillett

Copy link
Copy Markdown
Member

Updated with a non-rewriting merge of current trunk (d39fddb) and moved post-thumbnails and foobar cleanup into unconditional Tests_Theme_Support::tear_down() cleanup. The in-test removal assertions remain unchanged.

Validation completed:

  • PHPCS on all changed PHP files
  • Focused template and theme tests: 116 tests, 556 assertions
  • Randomized themes group with seeds 13194 and 13195: 627 tests, 7,276 assertions each (15 skipped)
  • git diff --check

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@sirreal
sirreal force-pushed the agent/test-order-themes-isolation branch from 59d9a5c to a922788 Compare September 9, 2026 12:18
@sirreal
sirreal marked this pull request as ready for review September 9, 2026 12:19
@github-actions

github-actions Bot commented Sep 9, 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.

Core Committers: Use this line as a base for the props when committing in SVN:

Props jonsurrell, lancewillett.

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

@lancewillett

lancewillett commented Sep 9, 2026

Copy link
Copy Markdown
Member

Reviewed a922788; no blocking findings. The cleanup restores theme state before the parent teardown, and the negative global-styles assertion now uses an unregistered block fixture.

Validation:

  • All three affected classes passed in single-site and multisite: 116 tests and 556 assertions each.
  • The themes group passed with random seeds 13194 and 13195: 633 tests and 7,289 assertions each, with 15 skips.
  • PHPCS passed all three changed PHP files.

Adversarial review · gpt-6

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants