node-cover icon indicating copy to clipboard operation
node-cover copied to clipboard

Cobertura report format

Open davidmoshal opened this issue 13 years ago • 10 comments

Am wondering how difficult it would be to produce a coverage reports using Cobertura's xml format?

Here is their XML report generating class:

http://www.devdaily.com/java/jwarehouse/cobertura-1.9/src/net/sourceforge/cobertura/reporting/xml/XMLReport.java.shtml

davidmoshal avatar Mar 30 '12 23:03 davidmoshal

@davidmoshal do you have a sample output file or files you could put online? Ideally it would be an entire directory, so I can take a look at what the full format looks like.

It is possible we don't have all the info that they do (like methods/branches), but we can see what we have.

itay avatar Mar 31 '12 00:03 itay

I do, for java, groovy and flex. However, the documentation contains literally every line of my companies code!

Dave

On Fri, Mar 30, 2012 at 5:42 PM, Itay Neeman [email protected] wrote:

@davidmoshal do you have a sample output file or files you could put online? Ideally it would be an entire directory, so I can take a look at what the full format looks like.

It is possible we don't have all the info that they do (like methods/branches), but we can see what we have.


Reply to this email directly or view it on GitHub: https://github.com/itay/node-cover/issues/14#issuecomment-4853501

davidmoshal avatar Mar 31 '12 07:03 davidmoshal

@davidmoshal sorry for the delayed reply!

Can you come up with an example with some test code so I can see what the output looks like?

itay avatar Apr 16 '12 20:04 itay

I am glad i've found this discussion. @itay here is DTD for the cobertural xml. It'd be great feature to include in cover, since xml reports can be inserted in such tools as Jenkins for example.

http://cobertura.sourceforge.net/xml/coverage-04.dtd

here is an example of actual xml report:

https://raw.github.com/jenkinsci/cobertura-plugin/master/src/test/resources/hudson/plugins/cobertura/coverage-with-data.xml

rpetrenko avatar Jun 06 '12 17:06 rpetrenko

@rpetrenko thanks for the link, that is useful. I've recently finished some other commitments, so I hope I'll have a few more cycles to spend on Cover in the near future!

Also, if you'd like to try your hand at this, feel free. Happy to provide guidance and accept a pull request :)

itay avatar Jun 06 '12 18:06 itay

Nice! Being able to view node coverage in java coverage reporting tools will be awesome.

davidmoshal avatar Jun 06 '12 19:06 davidmoshal

Hi itay ,

Do we have anything that has come up on this ?

preethinagashri avatar Jan 09 '13 04:01 preethinagashri

@preethinagashri I took a look at Cobertura. There are two issues:

  1. I can't seem to find any documentation of their format.
  2. From trying to reverse engineer it, it seems they collect a lot of data at the byte code level for Java that we simply don't have available for JavaScript.

I'd rather spend time trying to make the Cover HTML reporter better, so let me know if there are features we should add.

itay avatar Jan 15 '13 18:01 itay

This would be a great addition! Cobertura reports can be uploaded to codecov.io very easily too.

@itay is there a json export example you can show me? Thank!

stevepeak avatar Sep 21 '14 15:09 stevepeak

I don't have an example handy - I haven't run this in a while, unfortunately. It should be pretty easy to get one if you install the project though.

itay avatar Sep 22 '14 21:09 itay