Tests: Avoid repeated test invocations in Tests_WpTokenMap - #13478
Closed
SainathPoojary wants to merge 1 commit into
Closed
Tests: Avoid repeated test invocations in Tests_WpTokenMap#13478SainathPoojary wants to merge 1 commit into
SainathPoojary wants to merge 1 commit into
Conversation
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
wporg-sync
pushed a commit
that referenced
this pull request
Sep 10, 2026
Check all HTML5 named character references within each token map test instead of running a separate test for every token. Preserve the per-token assertions and include token names in failure messages. Reduce test invocations from 4,474 to 14, avoiding repeated test runner setup and teardown. Developed in: #13478 Props sainathpoojary. See #66074. git-svn-id: https://develop.svn.wordpress.org/trunk@63591 602fd350-edb4-49c9-b593-d223f7449a82
Member
wporg-sync
pushed a commit
to WordPress/WordPress
that referenced
this pull request
Sep 10, 2026
Check all HTML5 named character references within each token map test instead of running a separate test for every token. Preserve the per-token assertions and include token names in failure messages. Reduce test invocations from 4,474 to 14, avoiding repeated test runner setup and teardown. Developed in: WordPress/wordpress-develop#13478 Props sainathpoojary. See #66074. Built from https://develop.svn.wordpress.org/trunk@63591 git-svn-id: http://core.svn.wordpress.org/trunk@62767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates
Tests_WpTokenMapto avoid repeated test runner overhead for each HTML5 named character reference.Previously,
test_reads_token_at_given_offsetandtest_detects_all_tokenseach used a 2,231-item data provider (data_html5_test_dataset), creating 4,462 individual test invocations. Each invocation incurred PHPUnit test runner lifecycle overhead (setup, teardown, and event handling) for in-memory token map checks.Both methods now retrieve the dataset via a private helper method and assert all tokens within internal loops. This reduces the test case count from 4,474 to 14 while preserving all 24,587 assertions. Failure messages have also been updated to include the token name to maintain precise diagnostics if a regression occurs.
Performance
Performance measured locally across three consecutive runs comparing
trunkto this branch:Trac ticket: https://core.trac.wordpress.org/ticket/66074
Use of AI Tools
AI assistance: Yes
Tool(s): Github Copilot
Used for: Edge-case checks, and assistance with the PR description, implementation and testing were reviewed and verified by me.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.