New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Difference between PHPUnit <8 and 8+ with fatal errors and exit codes #740
Comments
Found that the new behaviour (returning exit code Here is a diff sebastianbergmann/phpunit@8.0.5...8.0.6, but at this moment I have no idea what change causes this issue. |
sebastianbergmann/phpunit#3564 seems like the closest match. And that's exactly what we did: infection/tests/Fixtures/e2e/PhpUnit_Depends_Order/tests/SourceClassTest.php Lines 22 to 29 in 050cff2
I guess this is by design: failing with a fatal error is never appropriate. Otherwise put, it was a bug when PHPUnit exited with 255. |
Since this was a bug in PHPUnit, do you think there's anything we should do about it? |
I think we should detect (fatal) errors not from the returned exit code, but by parsing PHPUnit process output. Example: No errors
Errors (syntax error):
Errors (exception):
|
Ok, nerermind. This new behaviour is related to Infection still understands errors and displays |
Because there was an error in the log.
Before:
And it was ok (IMO).
But now something has changed in PHPUnit as we get a different ouput for the same e2e script
After:
This output is no longer treated as "error" in infection.
The exit code is
2
on these lines:infection/src/Process/MutantProcess.php
Lines 117 to 119 in f4a72a8
But for PHPUnit < 8 exit code was
255
.Originally posted by @maks-rafalko in #738 (comment)
So, what was an error in PHPUnit <8, now is just a killed Mutant. IMO, we should update the code and support both cases (<8, 8+) to correctly "understand" (fatal) errors
The text was updated successfully, but these errors were encountered: