Repository navigation
Conversation
…iltered files A worker's serialized TestResult only carries the `numberOfTests` of the last file it executed. When that file has all of its tests excluded by `--group`/`--exclude-group`, the merged result used to claim the suite was empty and the run exited 1 despite a green summary (PHPUnit enables `failOnEmptyTestSuite` implicitly for explicit test selections). 942d6ae fixed this in `WrapperRunner::numberOfTestsSeenByWorker()`; these tests pin the behaviour: - with `--processes=1` the single worker deterministically ends on ZTest.php, whose only test is outside the filtered group, so the run must exit 0 (fails when the fix is reverted) - a selection that matches no tests at all must still exit non-zero Refs pestphp#1483
1 of 2 tasks
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.
What:
Description:
Follow-up to #1757, retargeted to
5.xas requested.The fix itself already landed on
5.xin 942d6ae (WrapperRunner::numberOfTestsSeenByWorker()), so this PR only adds the regression tests:--processes=1 --group=filteredthe single worker deterministically ends onZTest.php, whose only test is outside the group. A worker's serializedTestResultonly carries thenumberOfTestsof its last file, so without the fix the merged result claims the suite was empty and the run exits 1 despite a green summary. The test asserts exit code 0. It fails whennumberOfTestsSeenByWorker()is reverted toResultReflection::numberOfTests($result).--group=missingmust still exit non-zero, so the fix cannot mask real "0 tests" runs.Fixtures live in
tests/Fixtures/Suites/ParallelGroupFilteredLastFile, which is already excluded from the main suite.Related:
--parallelcauses overall process to fail with no reporting as to why even though all tests pass #1483