Skip to content

Repair wp/5.8 branch Actions: Swap phpunit/phpunit for a release PHP 5.6 and 7.0 can load - #84456

Open
desrosj wants to merge 1 commit into
fix-actions-5.8/fix-phpunit-dev-dependency-floorfrom
fix-actions-5.8/remove-phpunit-for-old-php
Open

desrosj wants to merge 1 commit into
fix-actions-5.8/fix-phpunit-dev-dependency-floorfrom
fix-actions-5.8/remove-phpunit-for-old-php

Conversation

@desrosj

@desrosj desrosj commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Part of #82935.

What?

Adds an "Install a PHPUnit release this PHP version can load" step to the unit-php job of unit-test.yml. On the PHP 5.6 and PHP 7.0 legs, after the Composer dependencies are installed, it sets config.platform.php to 5.6.20 or 7.0.33 and runs composer require --dev phpunit/phpunit:<version> --with-all-dependencies in wp-env's composer container: ^5.7.21 on PHP 5.6 (resolves to 5.7.27) and ^6.5 on PHP 7.0 (6.5.14). The tests still run the PHPUnit bundled in those legs' wordpressdevelop/phpunit images.

Why?

wp-env's composer service installs the dev dependencies with its own PHP version, so vendor contains phpunit/phpunit 7.5.20 (#84455) on every leg. The test bootstrap loads vendor/autoload.php, which autoloads PHPUnit 7.5's classes, and PHP 5.6 and 7.0 can't parse them:

Parse error: syntax error, unexpected ':', expecting ';' or '{' in /var/www/html/wp-content/plugins/gutenberg/vendor/phpunit/phpunit/src/Runner/Version.php on line 26

Removing phpunit/phpunit isn't possible: yoast/phpunit-polyfills, which WordPress 5.8's test library requires (#84942), requires it. composer remove fails ("Removal failed, phpunit/phpunit is still present"), and re-resolves PHPUnit to 9.6.38 on the way, which is a fatal error on PHP 5.6. So these legs swap it for the newest release their PHP supports instead. These are the same PHPUnit lines their images ship.

The changes to composer.json and composer.lock only exist inside the job.

How?

The condition is the same one the PHPUNIT variable uses to pick the image's PHPUnit.

wp/6.0 and wp/5.9 lock PHPUnit 5.7 for every leg instead, because their test libraries accept the PHPUnit 8.5 and 9.6 that the newer images ship. Here the PHP 7.4 and PHP 8.0 legs need Composer's PHPUnit 7.5, so the old-PHP legs swap it in the job.

PHPUnit 5.7 requires symfony/yaml, which every 2.x–4.x release blocks on security advisories. #84455 ignores them.

Use of AI Tools

This PR was created by Claude Code under my supervision. All code should be treated as AI-produced and not yet reviewed by a human until this PR is marked Ready for Review.

🤖 Generated with Claude Code

@desrosj desrosj added the [Type] Build Tooling Issues or PRs related to build tooling label Oct 9, 2026
@desrosj desrosj self-assigned this Oct 9, 2026
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fc0f1705-6656-417f-b431-f412f32b3408

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@desrosj
desrosj added this pull request to stack #84460 October 9, 2026 18:29
@desrosj
desrosj removed this pull request from stack #84460 October 10, 2026 00:22
@desrosj
desrosj changed the base branch from fix-actions-5.8/fix-phpunit-dev-dependency-floor to wp/5.8 October 10, 2026 00:23
@desrosj
desrosj force-pushed the fix-actions-5.8/remove-phpunit-for-old-php branch from 7726492 to 78ca33c Compare October 10, 2026 00:24
@desrosj
desrosj changed the base branch from wp/5.8 to fix-actions-5.8/fix-phpunit-dev-dependency-floor October 10, 2026 00:26
@desrosj
desrosj added this pull request to stack #84492 October 10, 2026 00:27
@desrosj
desrosj marked this pull request as ready for review October 13, 2026 01:12
@desrosj
desrosj marked this pull request as ready for review October 13, 2026 01:12
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: desrosj <desrosj@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@desrosj
desrosj removed this pull request from stack #84492 October 16, 2026 01:21
@desrosj
desrosj force-pushed the fix-actions-5.8/remove-phpunit-for-old-php branch from 78ca33c to 0fa8063 Compare October 16, 2026 01:21
@desrosj
desrosj added this pull request to stack #84874 October 16, 2026 01:21
@desrosj
desrosj removed this pull request from stack #84874 October 16, 2026 15:49
@desrosj
desrosj force-pushed the fix-actions-5.8/remove-phpunit-for-old-php branch from 0fa8063 to 60a65a1 Compare October 16, 2026 15:49
@desrosj
desrosj added this pull request to stack #84943 October 16, 2026 15:50
@desrosj desrosj changed the title Repair wp/5.8 branch Actions: Remove phpunit/phpunit before testing on PHP 5.6 and 7.0 Repair wp/5.8 branch Actions: Swap phpunit/phpunit for a release PHP 5.6 and 7.0 can load Oct 16, 2026
@desrosj
desrosj force-pushed the fix-actions-5.8/remove-phpunit-for-old-php branch from 60a65a1 to ac72b5f Compare October 19, 2026 17:09
@desrosj
desrosj removed this pull request from stack #84943 October 21, 2026 19:47
@desrosj
desrosj added this pull request to stack #85352 October 21, 2026 19:48
@desrosj
desrosj force-pushed the fix-actions-5.8/remove-phpunit-for-old-php branch from ac72b5f to 31ec0ac Compare October 22, 2026 18:35

@ramonjd ramonjd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The failing checks pass at the top of this stack (#85351).

@desrosj
desrosj force-pushed the fix-actions-5.8/remove-phpunit-for-old-php branch from 31ec0ac to f161058 Compare October 23, 2026 13:50

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants