Don't fail if there are no tests to mutate
See original GitHub issueI added a new module in my maven project which only contains resources, and our “QA” build that runs pitest failed:
[INFO] --- pitest-maven:1.1.4:mutationCoverage (default-cli) @ persistency-model ---
[INFO] Found plugin : Default csv report plugin
[INFO] Found plugin : Default xml report plugin
[INFO] Found plugin : Default html report plugin
[INFO] Found plugin : Default limit mutations plugin
[INFO] Found shared classpath plugin : Default mutation engine
52:35 AM PIT >> INFO : Mutating from /home/bamboo/bamboo-agent-home/xml-data/build-dir/COL-QA-JOB1/persistency-model/target/classes
6:52:35 AM PIT >> INFO : Verbose logging is disabled. If you encounter an problem please enable it before reporting an issue.
6:52:36 AM PIT >> INFO : Sending 0 test classes to slave
6:52:36 AM PIT >> INFO : Sent tests to slave
6:52:36 AM PIT >> INFO : Calculated coverage in 0 seconds.
6:52:36 AM PIT >> INFO : Created 0 mutation test units
[...]
[ERROR] Failed to execute goal org.pitest:pitest-maven:1.1.4:mutationCoverage (default-cli) on project persistency-model: Execution default-cli of goal org.pitest:pitest-maven:1.1.4:mutationCoverage failed: No mutations found. This probably means there is an issue with either the supplied classpath or filters.
This module doesn’t have any java source files.
It would be really nice if the mutationCoverage goal would simply skip this project, just like the maven compiler/surefire/etc plugins do.
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Don't fail task if Junit Test Results are not found
Is there a way to allow JunitTest Results Task to not fail if no test results are found?
Read more >PI test failing when no tests are found in the project
I am using pi test in parent pom, I am having the below issue when there are no ... org.pitest:pitest-maven:1.0.0:mutationCoverage failed: No test...
Read more >All test cases passed in junit but PIT is failing - Stack Overflow
When I inject a fault into my test suite and run Pitest, then it clearly shows me which tests fail. Even without enabling...
Read more >Mutation Testing - Who will test the tests themselves?
In this post I will be looking at mutation testing. This is aimed at people who are not familiar with mutation testing.
Read more >Mutation Testing: Too Good to Be True? - Nexocode
However, they can also give a false sense of confidence if they don't fail when errors are introduced. Code coverage reports can show...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ankon has a point though; if there are no Java source files to begin with, it sounds logical that mutations should not be attempted 😉
Definitely fixed, by this commit.