Skip to content

Commit

Permalink
Build/Test Tools: Enable testing for PHP 8.4.
Browse files Browse the repository at this point in the history
With PHP 8.4 due out in November later this year, contributors have been working on ensuring WordPress 6.7 is as compatible as possible. Enough progress has been made during this release cycle where PHPUnit tests now run successfully with no failures reported.

This change enables PHP 8.4 testing throughout Core’s GitHub Action workflows to ensure no new problems are introduced going forward.

There are two exceptions to this:
- The Importer plugin has some compatibility issues that produce test failures. There is an open pull request upstream, but these problematic tests have been marked skipped when running on PHP 8.4 until that PR is merged.
- Since no stable versions of xDebug with PHP 8.4 support have been published, these tests are also skipped for now.

Props jrf, desrosj.
See #62061.

git-svn-id: https://develop.svn.wordpress.org/trunk@59168 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
desrosj committed Oct 4, 2024
1 parent c5108d1 commit 2c17f65
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
db-type: [ 'mysql' ]
db-version: [ '5.7', '8.0', '8.1', '8.2', '8.3' ]
tests-domain: [ 'example.org' ]
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
db-type: [ 'mariadb' ]
db-version: [ '10.4', '10.6', '10.11', '11.2' ]
multisite: [ false, true ]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-phpunit-tests-v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ jobs:

# __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
- name: Run (Xdebug) tests
if: ${{ inputs.php != '8.3' }}
if: ${{ inputs.php != '8.4' }}
continue-on-error: ${{ inputs.allow-errors }}
run: LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -v --group xdebug --exclude-group __fakegroup__

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/upgrade-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
fail-fast: false
matrix:
os: [ 'ubuntu-latest' ]
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
db-type: [ 'mysql' ]
db-version: [ '5.7', '8.0' ]
wp: [ '6.0', '6.1', '6.2', '6.3', '6.4', '6.5', '6.6' ]
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
fail-fast: false
matrix:
os: [ 'ubuntu-latest' ]
php: [ '8.0', '8.1', '8.2', '8.3' ]
php: [ '8.0', '8.1', '8.2', '8.3', '8.4' ]
db-type: [ 'mysql' ]
db-version: [ '5.7', '8.0' ]
wp: [ '5.3', '5.4', '5.5', '5.6', '5.7', '5.8', '5.9' ]
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
fail-fast: false
matrix:
os: [ 'ubuntu-latest' ]
php: [ '8.0', '8.1', '8.2', '8.3' ]
php: [ '8.0', '8.1', '8.2', '8.3', '8.4' ]
db-type: [ 'mysql' ]
db-version: [ '5.7', '8.0' ]
wp: [ '4.1', '4.2', '4.3', '4.4', '4.5' ]
Expand Down
3 changes: 2 additions & 1 deletion .version-support-php.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"8.0",
"8.1",
"8.2",
"8.3"
"8.3",
"8.4"
],
"6-6": [
"7.2",
Expand Down
20 changes: 20 additions & 0 deletions tests/phpunit/tests/import/parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ public function set_up() {
* @covers WXR_Parser_XML::parse
*/
public function test_malformed_wxr() {
if ( PHP_VERSION_ID >= 80400 ) {
$this->markTestSkipped( 'The Importer plugin is not ready for PHP 8.4 yet. This skip should be removed once it is.' );
}

$file = DIR_TESTDATA . '/export/malformed.xml';

// Regex based parser cannot detect malformed XML.
Expand All @@ -42,6 +46,10 @@ public function test_malformed_wxr() {
* @covers WXR_Parser_Regex::parse
*/
public function test_invalid_wxr() {
if ( PHP_VERSION_ID >= 80400 ) {
$this->markTestSkipped( 'The Importer plugin is not ready for PHP 8.4 yet. This skip should be removed once it is.' );
}

$f1 = DIR_TESTDATA . '/export/missing-version-tag.xml';
$f2 = DIR_TESTDATA . '/export/invalid-version-tag.xml';

Expand All @@ -61,6 +69,10 @@ public function test_invalid_wxr() {
* @covers WXR_Parser_Regex::parse
*/
public function test_wxr_version_1_1() {
if ( PHP_VERSION_ID >= 80400 ) {
$this->markTestSkipped( 'The Importer plugin is not ready for PHP 8.4 yet. This skip should be removed once it is.' );
}

$file = DIR_TESTDATA . '/export/valid-wxr-1.1.xml';

foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML', 'WXR_Parser_Regex' ) as $p ) {
Expand Down Expand Up @@ -159,6 +171,10 @@ public function test_wxr_version_1_1() {
* @covers WXR_Parser_Regex::parse
*/
public function test_wxr_version_1_0() {
if ( PHP_VERSION_ID >= 80400 ) {
$this->markTestSkipped( 'The Importer plugin is not ready for PHP 8.4 yet. This skip should be removed once it is.' );
}

$file = DIR_TESTDATA . '/export/valid-wxr-1.0.xml';

foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML', 'WXR_Parser_Regex' ) as $p ) {
Expand Down Expand Up @@ -257,6 +273,10 @@ public function test_wxr_version_1_0() {
* @covers WXR_Parser_Regex::parse
*/
public function test_escaped_cdata_closing_sequence() {
if ( PHP_VERSION_ID >= 80400 ) {
$this->markTestSkipped( 'The Importer plugin is not ready for PHP 8.4 yet. This skip should be removed once it is.' );
}

$file = DIR_TESTDATA . '/export/crazy-cdata-escaped.xml';

foreach ( array( 'WXR_Parser_SimpleXML', 'WXR_Parser_XML', 'WXR_Parser_Regex' ) as $p ) {
Expand Down

0 comments on commit 2c17f65

Please sign in to comment.