Skip to content

Load PHPUnit dependencies after database install#1868

Merged
chubes4 merged 3 commits into
mainfrom
reproduce/2295-extensions-canary
Jul 18, 2026
Merged

Load PHPUnit dependencies after database install#1868
chubes4 merged 3 commits into
mainfrom
reproduce/2295-extensions-canary

Conversation

@chubes4

@chubes4 chubes4 commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • load and activate mounted PHPUnit dependency plugins after the managed test database is installed
  • replay only dependency plugins_loaded callbacks registered during post-install loading
  • document the canonical inactive extra_plugins plus dependencyMounts contract
  • add real Playground coverage for DB-touching activation and one-time callback execution

Why

WP Codebox previously forced validation dependencies into two broken choices: activate during recipe setup before wptests_* tables exist, or mount inactive and never load them during managed PHPUnit execution.

This surfaced after Extra-Chill/homeboy-extensions#2294 delegated its test runner to the public WP Codebox recipe contract.

Failure evidence: https://github.com/Extra-Chill/homeboy-extensions/actions/runs/29646694037/job/88086037491
Downstream repair: Extra-Chill/homeboy-extensions#2295

How to test

  1. Run npm install from a fresh checkout.
  2. Run npm run build.
  3. Run npx tsx tests/phpunit-project-autoload.test.ts.
  4. Run npm run test:playground-phpunit-readonly-cache-integration.
  5. In Homeboy Extensions PR #2295, run bash wordpress/scripts/test/playground-db-activation-smoke.sh against this branch.

Compatibility

The canonical caller contract is inputs.extra_plugins with dependency entries set to activate: false, plus their sandbox plugin directories in dependencyMounts. Dependencies now activate after managed PHPUnit installation and before tests. Newly registered dependency plugins_loaded callbacks run exactly once. No legacy lifecycle or Homeboy-specific behavior is introduced.

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenAI gpt-5.6-sol via OpenCode
  • Used for: Reproduced the downstream canary failure, implemented the generic PHPUnit lifecycle repair, added integration coverage, and prepared the PR under Chris Huber's direction.

@chubes4

chubes4 commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator Author

Merge dependency: #1869 fixes the pre-existing main production-boundary failure inherited by this PR. Recommended order: #1869, then #1868, then Extra-Chill/homeboy-extensions#2295.

@chubes4
chubes4 merged commit 7e45126 into main Jul 18, 2026
4 checks passed
@chubes4
chubes4 deleted the reproduce/2295-extensions-canary branch July 18, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant