Issue #13672: Kill mutation using utility class#13800
Merged
romani merged 1 commit intocheckstyle:masterfrom Sep 30, 2023
Merged
Issue #13672: Kill mutation using utility class#13800romani merged 1 commit intocheckstyle:masterfrom
romani merged 1 commit intocheckstyle:masterfrom
Conversation
29 tasks
Member
|
Pitest is not happy |
6e1a711 to
ba69205
Compare
Member
|
Still problem |
ba69205 to
b878463
Compare
Vyom-Yadav
suggested changes
Sep 30, 2023
| <param>com.puppycrawl.tools.checkstyle.checks.coding.IllegalTypeCheckTest</param> | ||
| </targetTests> | ||
| <avoidCallsTo> | ||
| <avoidCallsTo>org.apache.commons.logging</avoidCallsTo> |
Member
There was a problem hiding this comment.
Why avoid calls to Apache logging?
Contributor
Author
There was a problem hiding this comment.
By default when avoidCallsTo is not used then pit will by default avoid it but when we explicitly applied it will not be considered
https://pitest.org/quickstart/maven/#:~:text=If%20a%20list%20is%20not%20explicitly%20supplied%20then%20PIT%20will%20default%20to%20a%20list%20of%20common%20logging%20packages%20as%20follows
Member
There was a problem hiding this comment.
this actually required:
$ git diff
diff --git a/config/pitest-suppressions/pitest-common-suppressions.xml b/config/pitest-suppressions/pitest-common-suppressions.xml
index 4041118..34258c9 100644
--- a/config/pitest-suppressions/pitest-common-suppressions.xml
+++ b/config/pitest-suppressions/pitest-common-suppressions.xml
@@ -85,6 +85,24 @@
<sourceFile>Checker.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.Checker</mutatedClass>
<mutatedMethod>processFile</mutatedMethod>
+ <mutator>org.pitest.mutationtest.engine.gregor.mutators.VoidMethodCallMutator</mutator>
+ <description>removed call to org/apache/commons/logging/Log::debug</description>
+ <lineContent>log.debug("Exception occurred.", ex);</lineContent>
+ </mutation>
+
+ <mutation unstable="false">
+ <sourceFile>Checker.java</sourceFile>
+ <mutatedClass>com.puppycrawl.tools.checkstyle.Checker</mutatedClass>
+ <mutatedMethod>processFile</mutatedMethod>
+ <mutator>org.pitest.mutationtest.engine.gregor.mutators.VoidMethodCallMutator</mutator>
+ <description>removed call to org/apache/commons/logging/Log::debug</description>
+ <lineContent>log.debug("IOException occurred.", ioe);</lineContent>
+ </mutation>
+
+ <mutation unstable="false">
+ <sourceFile>Checker.java</sourceFile>
+ <mutatedClass>com.puppycrawl.tools.checkstyle.Checker</mutatedClass>
+ <mutatedMethod>processFile</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.NonVoidMethodCallMutator</mutator>
<description>removed call to java/io/IOException::getMessage</description>
<lineContent>new String[] {ioe.getMessage()}, null, getClass(), null));</lineContent>
diff --git a/pom.xml b/pom.xml
index 70f3a90..7be5ccf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4365,7 +4365,6 @@
<param>com.puppycrawl.tools.checkstyle.checks.coding.IllegalTypeCheckTest</param>
</targetTests>
<avoidCallsTo>
- <avoidCallsTo>org.apache.commons.logging</avoidCallsTo>
<avoidCallsTo>com.puppycrawl.tools.checkstyle.utils.UnmodifiableCollectionUtil</avoidCallsTo>
</avoidCallsTo>
<excludedMethods>
33 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #13672: Kill mutation using utility class