Escaped mutants in CI #1659
-
I'm facing a situation where some covered mutants are being reported as not detected. This issue only happens on CI, if I run Infection locally then they are marked as killed. If I SSH into my CI environment and manually apply the mutation to my code and then run PHPUnit manually the test cases do fail with Here is a Playground link that merely replicates my issue: https://infection-php.dev/r/4l0v. In my CI environment the I'm a bit stuck with this one so I'd appreciate any help or suggestions that could help me troubleshoot the problem. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
What versions are you using? Do you have Try using the latest version of Infection. I believe there was a similar issue fixed before. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the tips! I've found out that my CI environment does not have a default php > var_dump(ini_get('error_reporting'));
string(0) "" This is despite PHP documentation suggesting there is a default value that depends on the PHP version you are using (either Not having this defined lead to Notices not being converted into errors on my CI which lead to escaping mutants. When I tried running Infection by setting I will now go and fix my CI env missing |
Beta Was this translation helpful? Give feedback.
Thanks for the tips! I've found out that my CI environment does not have a default
php.ini
file and thus theerror_reporting
directives value is""
:This is despite PHP documentation suggesting there is a default value that depends on the PHP version you are using (either
E_ALL
orE_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
prior to PHP 8.0.0).Not having this defined lead to Notices not being converted into errors on my CI which lead to escaping mutants. When I tried running Infection by setting
error_reporting
toE_ALL
(32767):php -d error_reporting=32767 ./vendor/bin/infection
it works as expected.I will now go and fix my CI …