You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PHPUnit recipes apply wpConfigDefines only to the phpunit step, so plugin activation runs without them #2615
buildWordPressPhpunitRecipe (packages/runtime-core/src/recipe-builders.ts) passes wpConfigDefines only as the wp-config-defines-json arg of the wordpress.phpunit step. The activate_plugins phase runs earlier, without those constants. A plugin whose load path depends on an environment constant fatals during activation, and the run reports zero executed tests. buildWordPressBenchRecipe already applies its defines to the runtime through blueprintWithWpConfigDefines.
Observed with Jetpack's wpcomsh through Homeboy (wp_config_defines={"IS_ATOMIC":true}, the constant wpcomsh's own tests/bootstrap.php defines):
Recipe phase activate_plugins failed: wordpress.run-php crashed before producing a structured response
Fatal error: Uncaught Error: Call to undefined function get_blog_details() in /wordpress/wp-content/plugins/wpcomsh/wpcom-features/functions-wpcom-features.php:72
#0 …/vendor/automattic/jetpack-plans/src/class-current-plan.php(430): wpcom_site_has_feature('scheduled-updat...')
(wpcom_site_has_feature takes the IS_ATOMIC branch when the constant is defined.)
Desired
A PHPUnit recipe's wpConfigDefines are in effect for every phase that loads WordPress, including activate_plugins, with the same values the wordpress.phpunit step sees. Defining them in both places must not produce "constant already defined" notices. Existing PHPUnit handler overrides (e.g. the multisite pre-install WPMU_PLUGIN_DIR) keep working.
AI disclosure: Claude Opus (Pi, via Roadie) traced this from a Homeboy Lab run and wrote this issue.
Activity
chubes4 commentedon Dec 2, 2026
Fixed by #2616.