Code Coverage with Jenkins

EasilyBaffled picture EasilyBaffled · Jun 15, 2013 · Viewed 23.2k times · Source

I am being asked to use Jenkins to test code coverage for a Java Project. The issue is I have never used Jenkins and have scarcely little experience with actual code coverage. I have been searching a bit and I have come across JaCoCo and Cobertura as plugs. The issue is everything talking about them is above my head at this point. My question is this, as I understand it Jenkins and JaCoCo/Cobertura are used to run tests(Junit?), and report on how well the handle my code, but where do they get the test? Obviously I should make them, but what kind of files are these(again Junit?) and how do the tools get them?

If you are feeling generous, are there any good introduction level tutorials for these tools?

Answer

darijan picture darijan · Jun 15, 2013

Maybe try looking in this direction:

  • May your project be maven project
  • Use Jenkins (you already do)
  • Use Sonar

Sonar:

There are lot of tutorials how to use Jenkins+Sonar so I guess you will not have much trouble. Sonar is really powerful tool, one of the best I've seen so far. And there is a plugin for Jenkins (but it can be avoided with certain profile in your maven project's pom.xml file).