I have a Java project created in IntelliJ and using Gradle.
My repository is hosted on GitHub, I've also integrated Travis CI.
My tests are done using JUnit and Mockito, Java 8.
I'm looking for a tool that would automatically run tests whenever I push to my repository, providing me with information if tests passed and code coverage information. Would like it to generate a GitHub badge just like Travis CI does, so that I can see how each branch is covered and if it's passing.
Thanks!
I use JaCoCo to capture coverage statistics which get published to Coveralls to track coverage changes between builds and visualize the results. Coveralls also provides a badge with a coverage percentage.
Gradle/Travis/Github examples here and here
I decided to go with Codecov
Here's my GitHub repo with example implementation.
With https://codecov.io/, the official example here is more up to date compared to the best answer:
https://github.com/codecov/example-gradle
However, I the CodeCov badge is set up in a nice way in the best answer's code, compared to the official examples which seem to have no badge in the README.
EDIT: After trying to set up all of this, I really disrecommend using CodeCov for private repos (although it can work well for public repos). Full of bugs. Very mad.