Repository navigation
Conversation
…hes()` tests. See #66755.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
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.
On multisite,
Tests_Option_WpPrimeNetworkOptionCaches::wpSetUpBeforeClass()creates a second network (wordpress.org, path/), and the class never deletes it. Data fromwpSetUpBeforeClass()is committed outside the per-test transaction, and_delete_all_data()does not clearwp_siteorwp_sitemeta, so the network stays for the rest of the run. Network tests that run later then find it:Tests_Multisite_wpNetworkQuerygets an extra network in its results, andTests_Multisite_Bootstrap::test_get_network_by_path()matches the leakedwordpress.org/network. In the default orderoption/runs aftermultisite/, so this only shows in other orders.The other classes that create networks in
wpSetUpBeforeClass()delete them again, such asTests_Multisite_wpNetworkQuery::wpTearDownAfterClass().Trac ticket: https://core.trac.wordpress.org/ticket/66755
What changes
wpTearDownAfterClass()deletes the network'ssitemetaandsiterows on multisite, with the same queries asTests_Multisite_wpNetworkQuery.Testing
Locally with PHP 8.4.27, MySQL 9.7.4 and PHPUnit 9.6.39 on multisite:
option/wpPrimeNetworkOptionCaches.phpand then three multisite network test files,vendor/bin/phpunit -c pair.xml --filter 'Tests_Option_WpPrimeNetworkOptionCaches|Tests_Multisite_wpNetworkQuery|test_get_network_by_path|test_get_main_network_id_after_network_delete': 15 failures on trunk (9 inTests_Multisite_wpNetworkQuery, 5 data sets of the twotest_get_network_by_pathtests inTests_Multisite_Bootstrap, andTests_Multisite_Network::test_get_main_network_id_after_network_delete()), OK (57 tests, 126 assertions) with this change.vendor/bin/phpunit -c tests/phpunit/multisite.xml --filter 'Tests_Multisite_wpNetworkQuery|test_get_network_by_path|test_get_main_network_id_after_network_delete': OK (52 tests, 90 assertions) before and after.vendor/bin/phpunit --filter 'Tests_Option_WpPrimeNetworkOptionCaches::': OK (3 tests, 25 assertions) on single site and OK (5 tests, 36 assertions) with-c tests/phpunit/multisite.xml, before and after.-c tests/phpunit/multisite.xml --testsuite default --order-by=random(seeds 101 and 202).Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code and Codex
Used for: Investigation, code, local testing and PR wording. I reviewed the reasoning, the code and the test results, and I take responsibility for the contribution.
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.