-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
Probem when using Infection with bypass-finals #1275
Comments
Fantastic issue, I had this problem as well. Thanks for the excellent clarification. |
I think the bypass final also hijacks the file streamwrapper. I think the least we can do is error out if the streanwrapper is never used during the process |
That makes a lot of sense |
Unfortunately, I can't find a way on how to do it. During mutation process, we create our custom But in the provided example repo, So it's too late for Infection to check something. Also, I didn't find any solution on how to understand what are the stream wrappers already registered (particular classes). The only thing we can check is whether the stream has a wrapper or not: Another idea is to add I will continue investigating how and what we can do it, but any help is much appreciated here. UPD: we can try to do it with UPD2: related to dg/bypass-finals#9 |
Made a draft PR with Before:
After:
And part of the log file:
(note the fatal error at the end of the log) I think we have 2 points here:
While the first issue is under our control and we can fix it, the second one is nice to have and optional. Anyway, even if we add some code to Also, here is the e2e test that fails for the current master but will be fixed once we merge infection/include-interceptor#13 and update |
Whoever lands here, note that at this time |
Almost fixed*, but we are close. see my comment dg/bypass-finals#9 (comment) |
All mutations were escaping when i was running infection and i didn't know why. I did manually some mutations and the test failed like it should to kill de mutant.
After some tests i discovered that when i enabled the bypass-finals library, the mutation test didn't worked properly as you can see on the minimal project repo
To reproduce this issue you only need to execute the infection on the github repo with the minimal project
If you want to see the project working without the bypass-final, and see de mutants been killed just comment the test: "testGivenMockedTheThingAndAnyInputThenShoudReturnTrue" and the "_before" method on the MyTest.php
I'm not sure if this is a problem that should be fixed on this repo, or on Bypass-Finals repo, but i think it's important to point because this issue took a lot of time to be uncovered
Log with the Bypass-Finals
Log without the Bypass-Finals
The text was updated successfully, but these errors were encountered: