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
Resolve Pitest Issues - IllegalImportCheck (2) #7855
Comments
I'm on it |
Hey @rnveach Hardcoded commit Diff report |
@harsh-kukreja |
So @rnveach basically you want me to remove the line in pitest.sh and rerun the report command? |
You must run pitest report on a clean checkstyle master branch. We expect no changes to be done to the branch or the report. We want to see what is being reported right now to help us understand how to fix it. |
I have update the same comment @rnveach, please check also added the diff report |
@rnveach should i create a PR or i should wait for your confirmation? |
@harsh-kukreja You can start a PR but you have provided no guidance on what you plan to do since regression showed no cases to go by. If you can analyze the code and create a UT from it, then that is the best path. If you feel the only option is to remove the code to kill the mutation, then you need to prove to us why the code is not needed and won't cause any issues by removing it. |
@rnveach I removed if we want the if to not to work we can do the following:
Or else let the mutation survive |
@rnveach please rply |
This is not possible as it would violate our checkstyle rule that there should only be 1 return statement in a method.
We prefer to avoid this at any circumstance if we cannot find a way to kill and we know for sure the code is needed (or atleast sure enough that it is not a good idea to remove it).
As the code is written right now line 423 - 428 will not get executed because the I need more details on why there is absolutely no other way than to remove this code and no impact to the check. For example, lets look at a test case line by line where If it does prove to be never a difference, we can't rewrite the code some other way other than removing the |
Yes @rnveach you are right the if line at 422 will not get executed if there is illegalPackage import. |
And there is no way to rewrite the code to give us the same benefit as well as removing the mutation? For example, do we need to execute both loops or can we know ahead to only execute one? In this case this looks to be a yes, but, again, it is just an example.
It is not desirable, but it may be the only solution unless you can provide us another workaround. |
@rnveach How can we execute only one loop as the first loop checks for illegalpackage and other checks for illegalclass the solution i thought was the block of code which i gave |
@harsh-kukreja As stated above, it was just an example and I already said we couldn't do that and current tests should prove that if we did change the code. I am just seeing if we can think outside the box and see if there is some other way to implement this functionality to pass pitest without removing it. |
Hey @rnveach
We can write the code like this by concatenating both of them |
It seems to me that just creates more work than just removing the condition as we now have to concat them and then turn them back into an array again. I have thought about this and don't have any ideas either. I can't see a way around just not removing the condition. Feel free to start a PR to remove the code. |
Fix was merged |
Child issue of #7797 ,
checkstyle/.ci/pitest.sh
Line 83 in abf829f
The text was updated successfully, but these errors were encountered: