build: declare PHPUnit and Polyfills as composer dependencies - #150
build: declare PHPUnit and Polyfills as composer dependencies#150i-am-chitti wants to merge 4 commits into
Conversation
|
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 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #150 +/- ##
=========================================
Coverage 28.56% 28.56%
Complexity 161 161
=========================================
Files 15 15
Lines 1817 1817
=========================================
Hits 519 519
Misses 1298 1298
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
Currently, running tests locally via
npm run testfails for local developers with a fatal error on a fresh install:This occurs because:
yoast/phpunit-polyfillsandphpunitare not declared incomposer.json./var/www/html/vendor/, which is only installed on-the-fly during CI runs.This PR cleans up the local development and CI testing environments by:
phpunit/phpunitandyoast/phpunit-polyfillsas dev dependencies insidecomposer.json..wp-env.jsonto look inside the mounted plugin's vendor folder for the polyfills.package.jsonto execute./vendor/bin/phpunit(PHPUnit 9) instead of the WordPress core vendor path.wp-envstarts with a standard WordPress ZIP download by default, which does not contain a vendor/ directory inside /var/www/html .phpunit.ymlandmultisite.yml) to run a standardcomposer install --no-interactionand run./vendor/bin/phpunit. This removes the slow and redundant container-levelcomposer requirerun.Fixes
How to Test / Verification
npm run testUse of AI Tools
AI assistance: Yes
Tool(s): Antigravity
Model(s): Gemini 3.5 Flash
Used for: Identifying the local test suite provisioning failure, and find regression issue like adjusting the GitHub Action workflows to use standard composer install. Each change has been humanly reviewed by me.