How to merge two clover coverage report

Team, I am executing the same package files twice. For example my package contains 10 files. I am running sanity and basic test cases against 10 java instrumented files. If I run sanity alone am getting 20% and run basic alone test case am getting 30% coverage. Third step, In a single shot I am running both sanity + basic test case. Now the overall code coverage percentage is getting 24%. Here are my questions

1. I want to merge two report as a single report. Actually I am running basic test case one shot and sanity in second shot. So, How can I merge those report as a single report.
2. How they are calculating overall percentage as 24%. Is there any way to improve the coverage percentage

2 answers

1 accepted

0 votes
Answer accepted

You can't really merge two reports, but you can merge Clover databases and coverage files and generate report from merged database.

You can merge databases by using:

1 vote

Hi Sivaraj,

As your basic test has 20% coverage and sanity test 30% coverage, then after merging I would expect to see total coverage value in range (30%, 50%). If you see 24% then it means that you're doing something wrong during your test execution. The most probably your build setup is incorrect.

It's hard to tell without seeing detailed debug logs (feel free to raise a ticket on and attach files), but the most common reasons are:

  • deleting coverage recording files between runs - check if you don't run any 'clean' command between basic and sanity test
  • recompiling the same source file between test runs - check if you don't rebuild your entire application between basic and sanity test
  • deleting Clover database between test runs
  • using two different Clover databases and generating an HTML report against only one of them instead of both



Suggest an answer

Log in or Sign up to answer
Community showcase
Published Thursday in Jira

Updates to give you visibility into what's coming in Jira Server and Data Center

Hello, Community! My name is Gosia and I'm a Product Manager on Jira Server and Data Center here at Atlassian. Since 2002 when we launched our public issue tracker, jira.atlass...

265 views 1 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you