How to configure multi-module Maven + Sonar + JaCoCo to give merged coverage report?

I was in the same situation as you, the half answers scattered throughout the Internet were quite annoying, since it seemed that many people had the same issue, but no one could be bothered to fully explain how they solved it. The Sonar docs refer to a GitHub project with examples that are helpful. What … Read more

Filter JaCoCo coverage reports with Gradle

Thanks to, Yannick Welsch: After searching Google, reading the Gradle docs and going through older StackOverflow posts, I found this answer on the Official gradle forums! jacocoTestReport { afterEvaluate { classDirectories.setFrom(files(classDirectories.files.collect { fileTree(dir: it, exclude: ‘com/blah/**’) })) } } Source: https://issues.gradle.org/browse/GRADLE-2955 For older gradle versions < 5.x may need to use classDirectories = files(classDirectories.files.collect { … Read more

ember-cli-code-coverage mocha showing 0% coverage when there are tests

Few well integrated tools to establish accurate code coverage for ember-cli apps exist. (something like Istanbul for everything in app/) We ended up avoiding ember-cli-blanket and writing a rudimentary istanbul 78 integration with testem. Basically, it calls the istanbul cli against the single JS file output by ember build. Imprecise but consistent. We’ve used in … Read more

What is a reasonable code coverage % for unit tests (and why)? [closed]

This prose by Alberto Savoia answers precisely that question (in a nicely entertaining manner at that!): http://www.artima.com/forums/flat.jsp?forum=106&thread=204677 Testivus On Test Coverage Early one morning, a programmer asked the great master: “I am ready to write some unit tests. What code coverage should I aim for?” The great master replied: “Don’t worry about coverage, just write … Read more