Clover for separated integration tests in multi-module project

Hi,

 

We're evaluating Clover as our main coverage tool for our Maven projects and we're willing to pay for the Server License but we have a blocker issue.

 

Our projects have the following structure:

  • project
    • module-a
      • src/main/java
      • src/test/java (UTs)
    • module-a-it
      • src/test/java (ITs)

 

We're have no clover configuration within our poms. We use surefire for our UTs and failsafe for our ITs.

We run the following goal from the top project: 

     mvn clean coverage:instrument install clover:aggregate clover:clover

The problem is that even when the ITs pass, we end up with no coverage for our ITs.

image2016-9-16 10:23:40.png

 

What should we do?

Thank you

2 answers

0 votes

Hi Fer,

  1. This goal is wrong - 'coverage:instrument'. All Clover goals are prefixed with 'clover:' (or 'clover2:' in case of old Clover versions). 

  2. Do you need to run 'install' goal? Are there any specific requirements? I'm asking, because usually builds with Clover are configured to run till 'test' or 'verify' phase. Having a build running till the 'install' phase is not wrong, but keep in mind that it may install JARs with instrumented code into your local ~/.m2 cache. 

    Please try this command:
    mvn clean clover:setup verify clover:aggregate clover:clover

Cheers
Marek 

0 votes

PS: As soon as you solve the problem with lack of data in the HTML report, you may want be interested in fine-tuning of Clover configuration for Failsafe. I'm pasting you few links:

https://confluence.atlassian.com/display/CLOVER/Using+with+Surefire+and+Failsafe+Plugins

https://confluence.atlassian.com/display/CLOVER/Unit+Test+Results+and+Per-Test+Coverage

and some hacking:

https://confluence.atlassian.com/display/CLOVER/Updating+optimization+snapshot+file

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Dec 10, 2018 in Confluence

Organizing your space just got easier - Page Tree Drag & Drop is here

Hi Community! I’m Elaine, Confluence Product Manager. You may have read my earlier post about page tree in space navigation sidebar. I'm excited to share another improvement that helps you organize ...

198 views 6 7
Join discussion

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