itay / node-cover

Native JavaScript Code Coverage
http://www.cover.io
165 stars 17 forks source link

Cobertura report format #14

Open davidmoshal opened 12 years ago

davidmoshal commented 12 years ago

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

itay commented 12 years ago

@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.

davidmoshal commented 12 years ago

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 reply@reply.github.com 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

itay commented 12 years ago

@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?

rpetrenko commented 12 years ago

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

itay commented 12 years ago

@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 :)

davidmoshal commented 12 years ago

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

preethinagashri commented 11 years ago

Hi itay ,

Do we have anything that has come up on this ?

itay commented 11 years ago

@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.

stevepeak commented 9 years ago

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!

itay commented 9 years ago

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.