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.php
tests/LinkPageOperationsTest.php
tests/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.php is available to every discovered test.
--filter LinkPageOperationsTest does 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.
Problem
wordpress.phpunitin project mode discovers plugin test files before executing the bootstrap declared by the mounted project'sphpunit.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-platformPR #171 at commitac7ea32:Homeboy correctly scopes the request to:
tests/AbilityAuthorizationTest.phptests/LinkPageOperationsTest.phptests/LinkPageOwnerReferenceTest.phpThe Codebox runtime still discovers
tests/ArtistDirectSubscriberTest.phpand crashes before running any tests: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 missingAgentsAPI\\AI\\WP_Agent_Execution_Principal,get_site(), andswitch_to_blog(), all defined by the same project bootstrap.Persisted Homeboy runs:
defad187-aa51-498a-95fe-bc0387df14cd3694ac54-17ab-4e3b-b4c4-fb71f19aa072Expected
Acceptance criteria
tests/bootstrap.phpis available to every discovered test.--filter LinkPageOperationsTestdoes not discover unrelated plugin test classes first.AI assistance