OpenCover: possible to merge multiple reports into

2020-06-14 09:21发布

I'm using OpenCover to generate functional test coverage for a web application. These tests are fairly long running (3+ hours), so we've chopped them up into multiple tests that run in parallel. So instead of a single coverage report, there are six.

In order to import these coverage reports into SonarQube, I need to figure out a way to combine them into one uber report. ReportGenerator supports merging multiple reports into one, but creates HTML output, which is not something SonarQube can consume.

At this point my options are

  1. hand-roll an OpenCover report merger (blech!)
  2. Run my functional tests serially, substantially increasing failure feedback times

Any other options I'm missing?

3条回答
欢心
2楼-- · 2020-06-14 09:34

Newer version of Report generator has support for wild card.

You can provide all XML reports as "*.XML" and Report Generator will generate one consolidated report from it.

查看更多
放荡不羁爱自由
3楼-- · 2020-06-14 09:36

I have created the following ticket on the SonarQube .NET side to allow multiple coverage reports to be specified, and to aggregate them: http://jira.codehaus.org/browse/SONARPLUGINS-3666.

In the meantime though, I cannot think of other options besides the 2 you already had.

查看更多
乱世女痞
4楼-- · 2020-06-14 09:39

OpenCover has -mergeoutput argument that makes it to work with the -output file in an append-only fashion, preserving previous measurements found there. That should allow you to call individual test runs separately -- as long as your SUT is still same.

My experience with trying to run tests with different -filter arguments is that OpenCover refuses to reopen module that has been filtered out in a previous test run. Still, worth a try from my opinion.

查看更多
登录 后发表回答