This project has moved. For the latest updates, please go here.

Can i merge reports and form a third report with report generator?

Aug 30, 2012 at 9:13 PM

Open cover provides leads to many xmls. I will have about 1000 xmls by end of day tomorrow. Is there some howcome i could merge a few into or combine multiple reports? 

 

This is very urgent

Coordinator
Aug 31, 2012 at 6:16 AM

Hi nidasahar,

ReportGenerator supports merging reports, you have to call it in the following way:

ReportGenerator.exe "-reports:OpenCoverReport1.xml;OpenCoverReport2.xml;OpenCoverReport3.xml;" -target "coveragereport"

Wildcards are currently not supported for report files. I'm working on this.

Hope this helps.

Daniel

Aug 31, 2012 at 7:13 AM

Thanks Daniel. 

 

wildcards would be amazing. Its not letting me merge beyond some 200 odd .xmls. Can i some how merge 1000 +

Some workaround you could suggest.

 

Thanks,

Nida

Coordinator
Aug 31, 2012 at 7:18 AM

Hi Nida,

I assume that the report files are generated when executing unit tests? That means you execute your tests in 1000 steps. You could consider executing your tests in one step, then you get only one OpenCover report.

Which tool are you using for your tests (Nunit, MSTest, xUnit)? 

Aug 31, 2012 at 7:26 AM

Hi Daniel, 

Unfortunately, we are running a standalone cli tool with numerous options, that generates multiple output files with opencover. It cannot be run in one shot :( 

Hence the only option is to merge the many xmls. 

 

Can you suggest something better ? 

 

 

 

 

 

 

Coordinator
Aug 31, 2012 at 8:35 AM

You could write a simple tool that merges the OpenCover reports into a single XML file:

An OpenCover report looks like this:

<CoverageSession xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

...

</CoverageSession >

 

Now you could create a xml file that looks like this:

 

<root>

<CoverageSession xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">� �

...

</CoverageSession >

<CoverageSession xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">� �

...

</CoverageSession >

<CoverageSession xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">� �

...

</CoverageSession >

</root>

 

This file can be parsed by ReportGenertor.

Aug 31, 2012 at 6:21 PM
Edited Aug 31, 2012 at 8:04 PM

I wrote a tool to merge some 310 files and ReportGenerator crashed. How can i resolve this?  

Either that or it says it is reading the report and continues to stay in that state for ever (hang). 

 

Coordinator
Aug 31, 2012 at 9:14 PM

Could you please provide me the merged report (not your source code), then I will have a look.

Perhaps an OutOfMemoryException.

Aug 31, 2012 at 9:29 PM

Not Sure, if i can attach and send by email. Its 1.11 Gb file zip is around 115MB.

How do you want me to give you the file?

On Sat, Sep 1, 2012 at 2:44 AM, danielpalme <notifications@codeplex.com> wrote:

From: danielpalme

Could you please provide me the merged report (not your source code), then I will have a look.

Perhaps an OutOfMemoryException.

Read the full discussion online.

To add a post to this discussion, reply to this email (reportgenerator@discussions.codeplex.com)

To start a new discussion for this project, email reportgenerator@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Coordinator
Aug 31, 2012 at 9:35 PM

Could you upload the zipped file to Dropbox/Skydrive/Google Drive or a FTP server?

Sep 1, 2012 at 1:30 PM

Here you go. 

Do let me know once you are done. I will delete the link afterwards.

https://docs.google.com/open?id=0B9nXX-Szv1uZeVpIX05acXczdnc

 

Also, i did leave the report generator on the whole night, it took a couple of hours to get the report out. (around 10) 

 

 

Coordinator
Sep 2, 2012 at 9:47 AM

You can delete the file. I just completed the download.

Will have a look at the problem within the next days.

Thanks for your help.

Coordinator
Sep 4, 2012 at 6:22 PM

The problem with your merged report is, that it takes a lot of time to parse it and it uses a lot of memory, since the file has >1GB.

Please try this beta release: http://dl.dropbox.com/u/21096596/ReportGenerator_1.6.0.0_Beta.zip

I just added wildcard support. Some examples:

ReportGenerator.exe "-reports:OpenCoverReport*.xml;" -target "coveragereport"

ReportGenerator.exe "-reports:*\bin\Debug\coverage.xml;" -target "coveragereport"

 

Please let me know if this works for you and if the report generation is faster. It should be much faster, since many small reports are easier to handle than one big report.

Sep 5, 2012 at 4:48 AM

:)

Awesome... it tool around 149s for 311 .xmls and 491s for 927 .xmls... 

Amazing... job... i will use the beta version!

May 23, 2014 at 7:53 AM
It seems that the combining of reports doesn't combine the results if the same assembly is tested twice in different test lists.
Our unit tests and integration tests run under seperate builds, and each generate their own reports. Is it possible to combine the reports in such a way to show combined coverage?
Coordinator
May 23, 2014 at 8:09 AM
As long as the assemblies have the same name, merging should work.
If you can provide me a sample where it does not work?
Oct 7, 2014 at 5:50 PM
So Daniel, I don't mean to hijack this thread, but this means that I can't merge reports from different projects that are out of the same solution? For example... we've separated our Unit tests from our Integration tests into their own subprojects, but is running against the same set of code. I was hoping I could take the results from (for example):
OurTests.Unit.dll
OurTests.Integration.dll

and have the ReportGenerator roll the results up into one report. Based on this thread I'm reading that this won't work for me.

correct?
Oct 7, 2014 at 11:36 PM
Hi @karlkas

You should be able to merge your reports. I do this quite often in order to merge coverage runs from nunit and mstest as long as the target assemblies (those under coverage) are the same then this should work - reportgenerator is probably even more forgiving but if you code has changed between one execution and another than your reporting may look a little odd
Coordinator
Oct 8, 2014 at 8:14 AM
Hi @karlkas,
Shaun is right, as long as you target the same assemblies, merging should go well.
Just give is a try.