fix: honor project bootstrap before plugin test discovery
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start with the wordpress.phpunit entry point and the mounted project's phpunit.xml, then trace when tests/bootstrap.php is loaded relative to test discovery. Run the provided Homeboy review command with --filter LinkPageOperationsTest and verify that bootstrap fixtures are available, unrelated plugin tests are not discovered first, and selected tests produce structured results.
Written by the indexing model from the issue text.
Description
Problem
wordpress.phpunit in project mode discovers plugin test files before executing the bootstrap declared by the mounted project's phpunit.xml. A repository whose tests depend on bootstrap-owned fixtures crashes before any selected tests execute.
This regresses the project-bootstrap contract completed in #644 and the harness-before-discovery fix completed in #1771.
Reproduction
From Extra-Chill/extrachill-artist-platform PR #171 at commit ac7ea32:
homeboy review test extrachill-artist-platform \
--path /var/lib/datamachine/workspace/extrachill-artist-platform@refactor-170-owner-neutral-operations \
--changed-since origin/main \
--placement local \
-- --filter LinkPageOperationsTest
Homeboy correctly scopes the request to:
tests/AbilityAuthorizationTest.phptests/LinkPageOperationsTest.phptests/LinkPageOwnerReferenceTest.php
The Codebox runtime still discovers tests/ArtistDirectSubscriberTest.php and crashes before running any tests:
wordpress.phpunit crashed before producing a structured response
Error: Class \"EcTestWpdb\" not found at
/wordpress/wp-content/plugins/extrachill-artist-platform/tests/ArtistDirectSubscriberTest.php:5
[test-results] Total: 0, Passed: 0, Failed: 0, Skipped: 0
The class exists in tests/bootstrap.php, and the repository's local PHPUnit command honors that bootstrap: 246 tests / 1,330 assertions pass. Earlier aggregate runs also reported missing AgentsAPI\\AI\\WP_Agent_Execution_Principal, get_site(), and switch_to_blog(), all defined by the same project bootstrap.
Persisted Homeboy runs:
- aggregate changed-file run:
defad187-aa51-498a-95fe-bc0387df14cd - explicit filtered run:
3694ac54-17ab-4e3b-b4c4-fb71f19aa072
Expected
- Read the mounted project's PHPUnit configuration before test discovery.
- Execute its declared bootstrap before loading any test class.
- Restrict discovery to the selected files/filter when a focused workload is requested.
- Return structured zero/failure evidence only after the project bootstrap and selected test workload actually run.
Acceptance criteria
- A fixture class defined only in
tests/bootstrap.phpis available to every discovered test. --filter LinkPageOperationsTestdoes not discover unrelated plugin test classes first.- The Extra Chill Artist Platform reproduction executes its selected tests instead of reporting zero tests.
AI assistance
- AI assistance: Yes
- Tool: OpenCode
- Used for: Reproducing the failure, inspecting persisted Codebox artifacts, and drafting this report.
- Dominant language
- TypeScript
- Stars
- 17
- Forks
- 4
- Avg merge
- 1h 39m
- Merged PRs (30d)
- 45
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Automattic/wp-codebox
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Automattic/wp-codebox#2531 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Automattic/wp-codebox#2467 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Automattic/wp-codebox#2466 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Automattic/wp-codebox#2105 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Automattic/wp-codebox#2061 ·
Maintainers usually reply within 1 day
All issues in Automattic/wp-codebox
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Effect-TS/effect#8728 · 1 comment ·
Maintainers usually reply within 1 day
-
check:passed streams:add
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
linagora/twake-drive-mobile#436 ·
Maintainers usually reply within 1 day
-
[Bug] The shared instance selector's placeholder and no-match text ignore the display languagePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
apache/rocketmq-dashboard#5561 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
heygen-com/hyperframes#5002 ·
Maintainers usually reply within 1 day