-
-
Notifications
You must be signed in to change notification settings - Fork 160
-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
Infection (?) marks covered code as not covered #234
Comments
Turns out it's not a problem of the Infection. It's a problem with For example, there is a function on line 670, but there's not a word about it in the log: <line num="657" type="stmt" count="1"/>
<line num="660" type="stmt" count="5"/>
<line num="672" type="method" name="anonymousFunction:672#2533" complexity="3" crap="3" count="1"/>
<line num="673" type="stmt" count="1"/>
<line num="674" type="stmt" count="1"/> Like it never existed. |
@sanmai if you do multiple runs do you get inconsistent results around the number not detected? This is something we're facing at the moment on our project and I'm still trying to isolate the problem. |
Well, no. I'm getting consistent results in a sense that these methods are always missing. |
As an experiment I added an option to mutate whole files even if only mostly covered by tests. And with that option I get:
This option is trivial to implement once PR #235 gets merged. |
@sanmai Thanks for investigating this, I ran into the same issue today and was baffled by it. I'm a complete newcomer to infection and wondering how is |
This has been fixed without the |
@BackEndTea ah, awesome, thanks for the info! |
Similar issue here, coverage-clover.xml file does not have an entry for seems that it would be related to the fact that the array value on that line is a boolean ???? I mean really ???
|
@whatthefrog What version of infection are you running? #655 Should have fixed the possible issues with array coverage by checking if the parent array is covered. If you are using a version older than If the issue persists, please open an issue so we can investigate. |
I am using infection 0.9.3, I indeed realize it is quite old, did not pay attention at the beginning, as using php-7.0 0.10.0 requires php-7.1 ps: great powerful tool by the way |
TLDR: fixed by #256
Steps to reproduce:
git clone https://github.com/sanmai/LazyLINQ cd LazyLINQ composer install
Now run tests to verify 100% coverage. And run Infection.
It'll show there were not covered mutants. Indeed we can see them in the log:
But if we apply this mutant by hand:
sed -i 's/public function distinct/protected function distinct/g' src/LazyLINQ/LazyCollection.php
We'll get a failing test:
Clearly, this mutant isn't "not covered" by tests.
The text was updated successfully, but these errors were encountered: