11

I have a Jenkins build which build all my java/angularJS project. It launch testNG tests for the java part and karma tests for the javascript part. So I can generate one testNG report (for java) and one junit report (for karma test) in my Jenkins build. This is working very well.

Until now, I used cobertura to report the coverage of my java tests. But now I would like to add also a coverage report for my karma tests (generated by Istanbul with cobertura type). The problem is that, in Jenkins, I'm allowed to generate only one coverage report in a build (I can't add more that one 'publish cobertura coverage report' post build action). So how can I have these two coverage reports in a single Jenkins build?

Kara
  • 6,115
  • 16
  • 50
  • 57
clement
  • 489
  • 1
  • 5
  • 18
  • how about karma-coverage? It supports multiple reports. https://github.com/karma-runner/karma-coverage#multiple-reporters – Outsider Oct 23 '14 at 16:32
  • I already use karma-coverage to create report. But my problem is that in jenkins I don't know how to generate a second coverage report in a build. – clement Oct 24 '14 at 08:58
  • I don't get why you can't generate multiple reports in jenkins. Can you generate multiple reports in your local terminal? – Outsider Oct 24 '14 at 10:47
  • 1
    because when I edit my jenkins build, once I create a coverage report (used for java part) I can't add another coverage report. The 'publish cobertura coverage report' menu is disabled (I used `code` coverageReporter : { type : 'cobertura', dir : '../target/karma-coverage/' } `code` in my karma configuration file) – clement Oct 24 '14 at 12:24
  • Did you solve your problem? Currently I want to do the same thing, show two coverage for python test and karma in Jenkins. – qwetty Dec 15 '14 at 11:25
  • No sorry, I unfortunately had to create another build. If you find a solution, share it please ! – clement Dec 15 '14 at 12:59

2 Answers2

1

There's a nice plugin called HTML Publisher Plugin. You can generate HTML coverage reports and publish as much reports as you want under different titles in one Jenkins project. For example I generate html reports using karma+istanbul and then publish them to Jenkins.

On JUnit xml report files. You should import JUnit once enumerating all files probably from different directories but you can differentiate them with proper package names inside files.

norekhov
  • 3,915
  • 25
  • 45
0

If I'm right, you can't use, as a post build action, the same plug-in twice( note that I'm not really sure). I faced this problem when I worked as Jenkins plug-in developer for a company and the solution was to use a plug-in that make the same thing.

For example: for JUnit reports there is an official JUnit plugin and also XUnit. For my problem it was simple.

So, maybe you can find a plug-in that do the same thing as Cobertura or you can change the output format of the java coverage or karma coverage. For example, for java you can use EclEmma or Jacoco...

23ars
  • 647
  • 3
  • 16
  • 37