#59647 closed task (blessed) (fixed)
Test tool and unit test improvements for 6.5
Reported by: | hellofromTonya | Owned by: | |
---|---|---|---|
Milestone: | 6.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
Previously:
- #58955 (6.4)
- #57841 (6.3)
- #56793 (6.2)
- #55652 (6.1)
- #54725 (6.0)
- #53363 (5.9)
- #52625 (5.8)
- #51802 (5.7)
- #51344 (5.6)
This ticket is for various fixes and improvements in PHPUnit tests that don't have a more specific ticket, as well as general improvements to the GitHub Actions workflows that run automated testing.
Change History (46)
This ticket was mentioned in PR #5100 on WordPress/wordpress-develop by @johnbillion.
12 months ago
#1
- Keywords has-patch has-unit-tests added
#9
in reply to:
↑ 8
@
11 months ago
In 57058:
Build/Test Tools: Fix group for
wp_unique_prefixed_id()
tests.
Change the group from
functions.php
tofunctions
to match other tests.
Reviewed by jorbin.
Merges [57057] to the 6.4 branch.
@peterwilsoncc The functions.php
group was only renamed to functions
for trunk in [56971], it's still functions.php
in the 6.4 branch, so [57057] should probably also be in trunk only.
This ticket was mentioned in Slack in #core by peterwilsoncc. View the logs.
11 months ago
This ticket was mentioned in PR #5849 on WordPress/wordpress-develop by @hellofromTonya.
9 months ago
#15
Reorganizes the hooks tests to align to coding standards and consistency within the test suite.
- [X] Moves
WP_Hooks
method tests to into separate directory<GroupName>/<className>/<methodName>.php
. - [X] Splits the function tests in
actions.php
andfilters.php
into separate test classes within thetests/hooks
/ directory.
Trac ticket: https://core.trac.wordpress.org/ticket/59647
This ticket was mentioned in PR #5987 on WordPress/wordpress-develop by @jonsurrell.
9 months ago
#18
- Rename $p to $processor in tests (https://github.com/WordPress/wordpress-develop/pull/5975#discussion_r1472011462)
- Use static data providers - There was a mix in HTML API tests. Static is required in the next PHPUnit version and there's no harm in using all static data providers now.
Trac ticket: https://core.trac.wordpress.org/ticket/59647
This ticket was mentioned in PR #5987 on WordPress/wordpress-develop by @jonsurrell.
9 months ago
#19
Trac ticket: Core-59647
Rename $p
variable to $processor
in tests for clarity (https://github.com/WordPress/wordpress-develop/pull/5975#discussion_r1472011462).
Use static data providers. A mix of static and non-static data providers were used in HTML API tests.
Data providers are required to be static in the next PHPUnit version and there's no harm in using
them consistently now.
This ticket was mentioned in PR #5987 on WordPress/wordpress-develop by @jonsurrell.
9 months ago
#22
Trac ticket: Core-59647
Rename $p
variable to $processor
in tests for clarity (https://github.com/WordPress/wordpress-develop/pull/5975#discussion_r1472011462).
Use static data providers. A mix of static and non-static data providers were used in HTML API tests.
Data providers are required to be static in the next PHPUnit version and there's no harm in using
them consistently now.
This ticket was mentioned in PR #5998 on WordPress/wordpress-develop by @peterwilsoncc.
9 months ago
#23
Prevent HTTP failures connecting to WordPress.org from triggering test failures.
The WP_REST_Plugins_Controller_Test
runs in the standard test suite rather than the HTTP request test suite so this should stop the test from failing when wordpress.org connections are unavailable.
Trac ticket: https://core.trac.wordpress.org/ticket/59647
@peterwilsoncc commented on PR #5998:
8 months ago
#25
This ticket was mentioned in PR #6031 on WordPress/wordpress-develop by @desrosj.
8 months ago
#26
Trac ticket: https://core.trac.wordpress.org/ticket/59647.
8 months ago
#27
So I've run the coverage report on all 8.x PHP versions. There are more warnings on PHP 8.x versions, and more the higher you go because of the current beta support. Here's how I found that translating to test coverage numbers:
PHP Version | Lines % | Functions and Methods | Classes and Traits
-- | -- | -- | --
7.4 | 44.44 | 34.74 | 8.72
8 | 44.44 | 34.68 | 8.72
8.1 | 44.44 | 34.87 | 8.72
8.2 | 44.39 | 34.82 | 8.72
8.3 | 44.23 | 34.76 | 8.72
There are slight fluctuations in the overall coverage for lines, and functions and methods, but nothing greater than a few tenths of a percent. There will be a small change after committing this, but I think removing the variable all together allowing the version tagged latest
in Docker to be used (currently PHP 8.2) is the right way forward.
This ticket was mentioned in PR #6145 on WordPress/wordpress-develop by @costdev.
8 months ago
#33
Previously, the tests for WP_Plugin_Dependencies::get_dependency_names()
performed an API request to WordPress.org. If an HTTP failure occurred when connecting to WordPress.org, this could trigger test failures.
This mocks the API response to prevent HTTP failures from triggering test failures.
This ticket was mentioned in PR #6148 on WordPress/wordpress-develop by @costdev.
8 months ago
#36
The test_readme_mariadb_version()
test method has been experiencing HTTP failures that results in test and CI failures.
This switches to mariadb.org which may result in more stable test runs.
Some additional safety assertions are also included.
#43
@
7 months ago
- Resolution set to fixed
- Status changed from new to closed
Closing for now since 6.5 has been branched, so any new updates like this can happen in trunk for 6.6.
This ticket was mentioned in PR #6505 on WordPress/wordpress-develop by @johnbillion.
5 months ago
#44
I noticed when trying to run composer lint:errors
on my local installation that the process would run out of memory:
..........E.... Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 90366752 bytes) in vendor/squizlabs/php_codesniffer/src/Runner.php on line 547
This appears to be caused by phpcs trying to scan the *.i18n.php
translation files in the wp-content/languages
directory, of which I have quite a few due to testing this functionality.
These files shouldn't be scanned by phpcs so can be ignored.
Trac ticket:
https://core.trac.wordpress.org/ticket/59647
https://core.trac.wordpress.org/ticket/58955
This changes several instances of test skipping to test failures, and removes some unnecessary
function_exists()
checks for compat functions.If any of the checks in these test aren't satisfied then the test should fail rather than be skipped.
In addition, I removed some multisite test skipping which is redundant as it's handled by the
ms-required
andms-excluded
test group handling.Previously: