Repository navigation
Tests: Pick the PHPUnit configuration file from the installed PHPUnit version - #1
Conversation
…stead of running it in Docker. Composer installs dependencies on the runner with the same PHP version as the container, so the version can be read with `Composer\InstalledVersions` straight after install. This removes a container start from every job.
…led PHPUnit version. Adds tests/phpunit/phpunit-config.php, which prints the configuration file for the installed version. composer test, npm run test:php and CI use it, which removes the test10 and test:php10 scripts.
|
@robelsust @lancewillett What do you think about this? I've encapsulated the config file logic into a phpunit-config.php file that gets called inline for the I tweaked the readme too. |
|
Thanks John, I prefer keeping the existing commands and centralizing configuration selection. The selector passed checks for PHPUnit 9/10/11 version metadata, single-site/multisite mappings, and local overrides. Composer also preserved forwarded arguments, and PHPUnit 9 honored a later explicit One portability concern before landing: AI review · |
|
For users on Windows running tests via Docker ( There's not really a clean way to handle this unless we go with indirection, for example launching phpunit via |
Stacks on WordPress#14145 (WordPress#14145). Merging this into
feature/66210-phpunit-10-configadds these changes to that PR.Removes the separate
composer test10andnpm run test:php10commands.composer test,npm run test:phpand CI now pick the configuration file that matches the installed PHPUnit version.tests/phpunit/phpunit-config.php, which prints the configuration file for the installed PHPUnit version. Pass itphpunit.xml.distortests/phpunit/multisite.xmlto get the matching file. Run it with no argument to get the single site default, or a localphpunit.xmlif one exists.composer testrunsphpunit -c "$(php ./tests/phpunit/phpunit-config.php)".npm run test:phprunscomposer testinside the container, so the version check happens there.PHPUNIT_CONFIGthrough the script. The step is skipped on older branches that don't have the script, because they run this workflow from trunk./phpunit-10.xmlentry from.gitignore.Trac ticket: https://core.trac.wordpress.org/ticket/66210
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Implementation and testing. I reviewed the changes.