Repository navigation
fix(phpunit): report empty discovery as an empty result - #2570
Merged
Merged
Conversation
Discovery-only mode threw "PHPUnit discovery found no test files" and the discovery reader rejected files: [], so a component whose suite is entirely outside PHPUnit (standalone PHP smokes) could not get a discovery answer at all. Discovery now reports what exists; consumers decide whether zero PHPUnit files is acceptable. Execution mode still refuses to run nothing.
This was referenced Oct 21, 2026
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.
Part of Extra-Chill/homeboy#16202
Problem
wordpress.phpunit discovery-only=1could not answer "no PHPUnit files" for a component whose tests are all standalone PHP smokes (for example Extra-Chill/extrachill-community: 28 files undertests/, none*Test.php, nophpunit.xml). Two gates turned that valid answer into a crash:RuntimeException: PHPUnit discovery found no test files.readPluginPhpunitDiscoveryResultrejectedfiles.length === 0, so the command then failed withdiscovery-only completed without a valid discovery result.Homeboy's WordPress extension builds its test inventory from this discovery plus the component's standalone PHP tests. Its contract is "empty PHPUnit discovery is valid when the standalone list is non-empty; both empty is refused". Because discovery crashed, every standalone-only component's
review testevidence came backinvalid_evidence: internal runtime inventory producer failed … WP Codebox canonical PHPUnit discovery failed.Change
files: []with the existingNO_TEST_FILESlog line, instead of throwing.filesarray. Every element must still be a non-empty string.discover_testsbefore running PHPUnit) still refuses to run nothing, and an unreadable test root still fails.Verification
discovery-only reports an empty test root as an empty result.tests/directory that holds only a*-smoke.phpfile, and asserts exit 0 withfiles: [].runPhpunitCommand.phpunit-discovery-only(9),phpunit-changed-test-filter,phpunit-project-autoload,phpunit-result-paths,phpunit-runtime-failure-diagnostics,phpunit-runtime-rejection,phpunit-structured-evidenceandwordpress-runtime-discovery-contracts.homeboy review test extrachill-community --placement localwith this build (HOMEBOY_WP_CODEBOX_BIN) and the paired extension change. Discovery returnsfiles: [], the inventory is produced, and test evidence isstatus: complete. The run's only failures are the component's 4 genuinely failing smokes. Before this change the same run reportedPHPUnit discovery found no test files.AI disclosure: root cause, fix and tests by Claude Opus 5.5 (Pi coding agent) at Chris Huber's direction; reproduced and verified locally.