-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Issue #14894: Resolve pitest suppression for UnusedLocalVariableCheck #17998
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
base: master
Are you sure you want to change the base?
Conversation
|
Looks like the build is failing but interestingly when I run "mvn clean verify", the build succeeds locally including checkstyle checks. Not sure if I am missing something here. Unfortunately I am unable to reproduce the checkstyle errors for the test code locally where the build fails. Error on Github CI at ci/semaphoreci/pr: Checkstyle CI pipeline on Semaphore These are the commands I used for checking build and pitest suppressions-
Output: Killed Mutations (locally): Environments: Please do let me know if I am missing something trivial. |
|
|
Github, generate report for UnusedLocalVariable/all-examples-in-one |
|
Report for UnusedLocalVariable/all-examples-in-one: |
|
Ok, just one violation to resolve |
7d38616 to
288e13c
Compare
|
Github, generate report for UnusedLocalVariable/all-examples-in-one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
items:
| public void testGetBlockContainingLocalAnonInnerClassTraversal() throws Exception { | ||
| final UnusedLocalVariableCheck check = new UnusedLocalVariableCheck(); | ||
|
|
||
| final DetailAST root = JavaParser.parseFile( | ||
| new File(getPath("InputUnusedLocalVariableAnonInnerClassesDeepNesting.java")), | ||
| JavaParser.Options.WITHOUT_COMMENTS | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests should be only by verifyWithInlineConfigParser.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found similar tests from line 511 onwards -
Line 511 in bf7a474
| public void testClearStateAnonInnerClass() throws Exception { |
So I tried using similar ways to test the traversal to kill mutations. I used
verifyWithInlineConfigParser to parse the resource test file InputUnusedLocalVariableAnonInnerClassesDeepNesting.java violations.
Would you like me to move this test to the end of the file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testClearStateAnonInnerClass()
Is very special to confirm that all fields are cleared between executions on different files.
Better to add comment over it that this method very special allowance to not use general verifyWithInlineConfigParser
|
Report for UnusedLocalVariable/all-examples-in-one: |
Issue #14894