Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display SCCT coverage in Jenkins

We have got SCCT to produce some pretty web-pages showing the coverage of our unit tests. And now we want to integrate this into our Jenkins continuous integration build.

I have created a Jenkins job to run the SCCT tests but how to a) fail the build if the coverage is below n% and b) how to display these pretty web-pages?

The build is a maven-multi-module project.

Cheers

like image 684
Paul McKenzie Avatar asked Aug 23 '12 13:08

Paul McKenzie


2 Answers

We are using the jenkins cobertura plugin. SCCT emits a cobertura-format coverage xml file for each module (I didn't spot at first) and the cobertura plugin collates these. One problem is that the cobertura plugin needed to be downgraded to 1.3 as otherwise it thinks that the mojo hasn't been run and doesn't do anything.

like image 93
Paul McKenzie Avatar answered Nov 07 '22 15:11

Paul McKenzie


Since this is possible for other coverage tools like cobertura via a jenkins plugin, you could either

  • convert the output of SCCT to something looking like the results of an existing tool and use the matching jenkins plugin.

  • write your own jenkins plugin, possibly borrowing code from existing plugins for other coverage tools.

like image 23
Jens Schauder Avatar answered Nov 07 '22 15:11

Jens Schauder