Repository navigation
fix(phpunit): apply wpConfigDefines before plugin activation in PHPUnit recipes - #2616
Merged
Merged
Conversation
Collaborator
Author
|
End-to-end check through Homeboy's WordPress PHPUnit adapter (
The AI disclosure: Claude Opus (Pi, via Roadie) reviewed this and ran the end-to-end check. The implementation is GPT-6.2 Sol (Homeboy Cook). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PHPUnit recipes previously passed
wpConfigDefinesonly to the test runner, so plugins that needed those constants could fail during activation. The recipe now writes the constants to the runtime’swp-config.phpbefore activation and still passes the same values to PHPUnit’s separate test config. In a local CLI run, the fixture that requiresFIXTURE_ENVfailed inactivate_pluginsbefore the fix; after the fix, it activated and its PHPUnit test passed without duplicate-constant warnings.What changed
defineWpConfigConstsstep, with an explicit wp-config rewrite for PHPUnit.WPMU_PLUGIN_DIRoverride.wpConfigDefinesretain their existing behavior.Verification
All gates passed on
9721b76. Basemain@81e8bd5unchanged.HOMEBOY_LINT_BASE=81e8bd506d50ff0a1366a5a9789915950d4ad488 homeboy --placement local review lint wp-codebox --path . --…: passed, 161641 ms; retained gate metadata.npm run build: passed, 604 ms; retained gate metadata.npx tsx --test tests/phpunit-discovery-only.test.ts tests/phpunit-project-autoload.test.ts: passed, 2609 ms; retained gate metadata.Cook run
agent-task-f81925ac-a559-46bf-82d5-0238b5c2faf0agent-task-f81925ac-a559-46bf-82d5-0238b5c2faf0-attempt-1-a022467703300929127196c7f8581e721cb55d25dea71f6e03300929127196c7f8581e721cb55d25dea71f6e03300929127196c7f8581e721cb55d25dea71f6eEvidence
recipe build phpunitgenerated the recipe withwpConfigDefines: { FIXTURE_ENV: true }, thenrecipe-runreportedrun_blueprint_stepscompleted duringruntime.create,activate_pluginscompleted withfixture-env/fixture-env.phpactive, andFixtureEnvTest::test_fixture_envpassed. No duplicate-constant warnings appeared in the CLI output or artifacts. The same fixture on the unchanged checkout failed inactivate_pluginswithFIXTURE_ENV missing.AI disclosure
Tool: Homeboy Cook. Agent: Homeboy (roadie). Model: roadie · route cook-heavy · served gpt-6.2-sol. Cook time: 39m50s.
AI traced the startup and activation order, implemented the fix, and verified it with focused tests and a CLI fixture, under the direction of the Cook requester. Homeboy reports controller verification separately from this account of the AI's work. A human reviews before merge.
Refs #2615