Repository navigation
Tests: Group tests that depend on Core assets - #13522
lancewillett wants to merge 2 commits 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. |
adimoldovan
left a comment
There was a problem hiding this comment.
The following tests also read Core assets but have no @group assets. A missing file fails them in the full suite, but the reduced job in #13523 never runs them.
- tests/phpunit/tests/oembed/template.php: the eight
test_oembed_output_*methods loadtheme-compat/embed.php, which readswp-embed-template.cssandwp-embed-template.js.test_get_post_embed_htmlreadswp-embed.js. - tests/phpunit/tests/view-transitions/wpEnqueueViewTransitionsAdminCss.php:
test_wp_enqueue_view_transitions_admin_cssbuilds a newWP_Styles, which readsview-transitions.css.
|
Thanks, Adrian. Added all ten annotations in d566a19. The expanded Missing-file probes now complement the earlier truncation experiment: removing either embed template asset or These paths already select the assets job in #13523. Both PR descriptions now include the updated validation; #13522 still needs to land first. CI is running on the new commit. Adversarial review · |
johnbillion
left a comment
There was a problem hiding this comment.
Looks good. Can always add other tests that depend on assets as they're discovered.
Add the assets group to existing tests that depend on Core JavaScript and CSS files, covering shortcode regex parity, oEmbed rendering, CSS inlining and hoisting, admin view transitions, and generated script modules. Allow these tests to be selected with --group assets while retaining their existing groups and normal suite coverage. This prepares for reduced PHPUnit runs on changes limited to Core assets. Developed in: #13522 Props adrianmoldovanwp, johnbillion. See #65889. git-svn-id: https://develop.svn.wordpress.org/trunk@63628 602fd350-edb4-49c9-b593-d223f7449a82
Add the assets group to existing tests that depend on Core JavaScript and CSS files, covering shortcode regex parity, oEmbed rendering, CSS inlining and hoisting, admin view transitions, and generated script modules. Allow these tests to be selected with --group assets while retaining their existing groups and normal suite coverage. This prepares for reduced PHPUnit runs on changes limited to Core assets. Developed in: WordPress/wordpress-develop#13522 Props adrianmoldovanwp, johnbillion. See #65889. Built from https://develop.svn.wordpress.org/trunk@63628 git-svn-id: http://core.svn.wordpress.org/trunk@62804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Some PHPUnit tests depend on Core JavaScript and CSS files, so they must remain covered when testing is narrowed for frontend-only changes.
Add an
assetsgroup to 17 existing test methods covering shortcode regex parity, oEmbed rendering, CSS inlining and hoisting, admin view-transition CSS, and generated script-module files. The annotations allow--group assetsselection while keeping every test in its normal suite.The selection includes the methods identified by the empty-assets experiment in Trac comment 4, plus nearby tests that read assets or require them to exist. Emptying a file does not necessarily fail tests whose expectations are derived from that file.
This PR adds test annotations only. Workflow routing is proposed separately in PR #13523, which depends on this group landing first. Bundled-theme metadata, test fixtures, and build tooling still need normal testing; this group does not establish that every
.jsor.csschange can use reduced coverage.Trac ticket: https://core.trac.wordpress.org/ticket/65889
Testing notes
Validation with PHP 8.3.32, MySQL 9.7.2, and PHPUnit 9.6.36:
--group assets: 33 tests / 301 assertions passed on both single site and multisite.npm run build:devin Node 24 Docker.An earlier isolated experiment emptied 1,295 source and generated
.js/.cssfiles undersrc/js/,src/wp-admin/css/,src/wp-admin/js/,src/wp-includes/css/,src/wp-includes/js/, andsrc/wp-includes/build/after building. Bundled themes and test fixtures were kept intact.Tests_Image_Functions::test_wp_crop_image_with_url. That test still failed alone after restoring assets (error_loading_image:File does not exist?for the remote image), so it was not attributed to asset truncation.assetsgroup passed again: 23 tests / 253 assertions.The full runs were not green: each reported 11 failures and 86 warnings, with 44 single-site skips and 46 multisite skips. The result supports the group for the tested asset paths; it is not a claim of exhaustive coverage for every frontend file.
Review follow-up
Added the ten methods identified in Adrian’s review: eight oEmbed output tests,
test_get_post_embed_html(), andtest_wp_enqueue_view_transitions_admin_css().Missing-file checks complement the earlier file-truncation experiment:
wp-embed-template.cssorwp-embed-template.jscaused the newly selected oEmbed output test to error.wp-embed.jscaused the newly selectedtest_get_post_embed_html()to error.view-transitions.cssemitted a warning, but the enqueue-only test still passed. Its group annotation includes the asset read in reduced runs; the existingtest_inline_css_included()supplies the content assertion.The neighboring tests in these two files were checked for the same dependency; no additional annotations were identified there.
Use of AI tools
AI assistance: Yes.
Tool: Codex.
Model: GPT-6.
Used for: Auditing asset-dependent tests, adding group annotations, and local validation.