Skip to content
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

Correctly handle exception code mutants #1734

Merged

Conversation

romm
Copy link
Contributor

@romm romm commented Oct 6, 2022

I've been having this issue but don't really know where to start in order to fix this, so I thought the best way would be to provide a failing test.

When Infection creates the DecrementInteger and IncrementInteger mutants on an exception code, even if this code is part of a test, the report will mark those two mutants as uncovered. Changing the code manually leads to a failing test.

Any hint on how we could fix this behavior?

@romm romm changed the title Add failing test for exception code mutants marked as uncovered Correctly handle exception code mutants Oct 6, 2022
@maks-rafalko
Copy link
Member

I think this is the same issue as #1673 and the root cause is because coverage driver doesn't mark this line as covered. So in the first place this is not an Infection bug.

However, we did a fix previously for similar issue and if you want to help fixing this issue with exceptions, please look at #655

@romm
Copy link
Contributor Author

romm commented Oct 9, 2022

Thanks for the hint, I'll try to take a look at it. 🙂

@romm
Copy link
Contributor Author

romm commented Dec 14, 2022

This PR will be solved with #1777 and work done in sebastianbergmann/php-code-coverage#964.

I can close this PR, but we could also rebase on master when #1777 is merged, so this library has a new test to prevent future regression with this particular case.

WDYT?

@maks-rafalko
Copy link
Member

If you have time and energy to wait & rebase and complete this test, that would be awesome IMO

@maks-rafalko
Copy link
Member

@romm could you please rebase , #1777 is merged

@romm romm force-pushed the fix/exception-code-mutants-uncovered branch from 7bb8da1 to 8557d95 Compare April 5, 2023 16:09
@maks-rafalko maks-rafalko marked this pull request as ready for review April 5, 2023 17:31
Copy link
Member

@maks-rafalko maks-rafalko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @romm

Now it passes

@maks-rafalko maks-rafalko merged commit 803f913 into infection:master Apr 5, 2023
40 checks passed
@romm
Copy link
Contributor Author

romm commented Apr 5, 2023

Thank you for the reminder! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants