General Discussion

Best way to publish Coverage results with Jenkins CI

Started by Otometrics on 10,066 views

I use the console tool as part of our Jenkins driven CI process, and want to publish the coverage results from NCrunch.
It appears as I either can publish the HTML report only, but I would to show everything including drill-down to uncovered lines of code.

Is your report format or data compatible with other coverage tools (like for instance Emma or Cobertura) then I could use their plugin's as publishers, or are you aware of any tools that can convert NCrunch report to one which is recognized by a Jenkins coverage reporting plugin.

Br
Jens Brejner
Hi Jens,

Thanks for posting!

Right now, all we have is the contents of the console tool's results directory. The coverage export file in this directory likely won't be compatible with any of the other tools that you use. The reason for this is because NCrunch's coverage data is flatly stored by source file documents and line numbers, rather than by methods and instructions. This makes it problematic for us to export the data in a way that is compatible with other tools.

We're looking at ways of doing this as we progress with work on the console tool. For the time being, unfortunately you'll be limited to the HTML report for viewing your coverage unless you write a custom parser for the XML export.
Hi Remco.
Thank you for your reply.
It could be an option for me to write my own parser / converter, so the results can be presented in Jenkins. I will take a look at what it would require.
Br
Jens
Hi Remco.
Now I how been messing around a bit, and I will suggest that you try to contact Daniel who is authoring this tool https://github.com/danielpalme/ReportGenerator, then NCrunch could come on the list AND NCrunch would become even more attractive for Jenkins CI users, because we would get at reasonable way of publishing NCrunch results.

Br
Jens
Hi Jens,

Unfortunately, for this to work, we'd first need to find a way to extract the results from the engine by method/class rather than by source file. This is where the hard part is :) Once we have that in place, I don't expect it will be difficult to support a range of different coverage formats.
@Remco is this something you are actively looking into adding? It would be very useful to have code coverage in another format.
jonas wrote:@Remco is this something you are actively looking into adding? It would be very useful to have code coverage in another format.


Hi. Perhaps we might be able to implement this in the long term, but being totally honest with you, I don't see this appearing in the next 6-12 months.
Remco wrote:
jonas wrote:@Remco is this something you are actively looking into adding? It would be very useful to have code coverage in another format.


Hi. Perhaps we might be able to implement this in the long term, but being totally honest with you, I don't see this appearing in the next 6-12 months.


@Remco Thanks for the honest reply! I totally understand.
Remco wrote:
jonas wrote:@Remco is this something you are actively looking into adding? It would be very useful to have code coverage in another format.


Hi. Perhaps we might be able to implement this in the long term, but being totally honest with you, I don't see this appearing in the next 6-12 months.


Good morning,

this was a bit over two years ago, can we make a custom export yet?
Or maybe a text output in the log going "Coverage: 93%"?

Greetings,
Marlon Regenhardt
Hi Marion,

We haven't implemented specifically this feature, but we have done something similar that perhaps you could adapt for your needs.

As of v4.5, NCrunch is now able to export code coverage data in partcover format. You can export this using the export button on the Tests Window toolbar, and it is also automatically exported by the NCrunch console tool.

The partcover file contains the coverage data in IL sequence point form, so it's aligned with the basic method/class structure. I would hope it should be relatively simple to write a tool that can read from this file and translate it to whatever format you need.

Post a reply

Log in to reply.