4

Is there an API for the Clover plugin, to be able to retrieve the coverage stats in JSON or something similar?

Can Jenkins Api be used for getting clover coverage report. Looks like it is possible with Cobertura but could not find anything for clover.

Manas
  • 177
  • 3
  • 13
Craig
  • 4,268
  • 4
  • 36
  • 53
  • Jenkins is your CI. What language are you using? – Steve Peak Feb 10 '15 at 22:23
  • I'm talking REST API, so it is abstract of any language – Craig Feb 12 '15 at 03:15
  • I'm still slightly confued but...(full disclosure I made this) maybe Codecov is what your looking for. You can upload your clover reports there. Try this: https://github.com/codecov/example-php – Steve Peak Feb 12 '15 at 16:56
  • can u post sample clover.xml (result sample) like gist ? so I can setup jenkins to try, it shall be easily exposed via normal REST API. – Larry Cai Jul 02 '15 at 05:17

1 Answers1

0

Unfortunately the Jenkins Clover Plugin does not expose any REST API. What you could try to do is to write a plugin which would expose content of clover.xml file via REST. In case you're interested in coverage summary only (i.e. not a coverage for every single source line) then you could also read build results metadata. Clover Plugin already parses the clover.xml file and stores coverage %. See:

https://github.com/jenkinsci/clover-plugin/blob/master/src/main/java/hudson/plugins/clover/CloverPublisher.java#L196

Marek
  • 748
  • 6
  • 13