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
Escaped Mutant does not escape when mutation is tested manually #1273
Comments
You can see this better from the coverage report: If |
You are correct about It looks to me that if a test becomes risky due to a mutation then this is interpreted by Infection as "passing". That would be a bug, IMO. |
What Infection looks at is the exit code. If there's a funny test, but PHPUnit exits with a zero code, then Infection thinks that all tests are passing. And indeed in this case of a risky test Infection will see a non-error exit code. PHPUnit says it's OK to have a risky test:
|
I think Infection should call PHPUnit with |
Infection can't know if risky tests are OK or not, all the while you are, as any other user, in a perfect position to make this decision. What you need is to add |
I disagree. If a test is not risky before a mutation but risky after a mutation then Infection should not treat the mutant as escaped. |
There's nothing to disagree. It will do as you want it, if you add If you want Infection to track changes in the number of tests, there are two problems:
Consider that we have users where running Infection takes tens of minutes or even hours. This time will have to be doubled, just because a user can't decide if they want |
This information should be available in the XML logfile that can be generated with |
True, there's a counter for warnings, but, again, with the second point argument, and with incomparable ease to add something like this, I don't think there will be any movement unless there's a very needy volunteer. |
…tercepted in the current process by Infection's stream wrapper see infection/infection#1273
…ready set Fixes #1274 Since PHPUnit won't treat new risky tests as failures by default, and since this behavior causes an unnecessary confusion even for experienced users (see #1273), we add failOnRisky="true" and failOnWarning="true" by default unless a conflicting directive is present, just like we do with executionOrder="random". That is, if there's already failOnRisky="false" then it should not be changed.
…ready set Fixes #1274 Since PHPUnit won't treat new risky tests as failures by default, and since this behavior causes an unnecessary confusion even for experienced users (see #1273), we add failOnRisky="true" and failOnWarning="true" by default unless a conflicting directive is present, just like we do with executionOrder="random". That is, if there's already failOnRisky="false" then it should not be changed.
can't reproduce it on any of the commits before and after introducing
Infection version: master 33ba2d3 @sebastianbergmann if you will face this issue again, please open an issue |
…ready set (#1280) Fixes #1274 Since PHPUnit won't treat new risky tests as failures by default, and since this behavior causes an unnecessary confusion even for experienced users (see #1273), we add failOnRisky="true" and failOnWarning="true" by default unless a conflicting directive is present, just like we do with executionOrder="random". That is, if there's already failOnRisky="false" then it should not be changed.
I started to use Infection in one of my projects,
code-unit
, and noticed something weird. Could be a bug, or I may be confused -- in which case this might be a support issue.This is my
infection.json
configuration file:Here is the output I get:
The first escaped mutant mutated the code like so:
"Escaped mutant" means that the tests still pass with the change introduced by the mutant. However, that is not the case when I make the change manually and run PHPUnit manually without Infection:
By the way, the escaped mutants 1 and 2 look identical to me.
The text was updated successfully, but these errors were encountered: