Skip to content

PHPUnit recipes apply wpConfigDefines only to the phpunit step, so plugin activation runs without them #2615

Done

Description

@chubes4

Problem

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

  1. chubes4 commented on Dec 2, 2026

    @chubes4
    CollaboratorAuthor

    Fixed by #2616.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions