Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,462,434
Community Members
 
Community Events
176
Community Groups

Maven +Openclover generate aggrigate test report for multi-module project

Dears,

Parent.pom
     module1.pom
         target/clover/module1Clover.db
     module2.pom
         target/clover/module2Clover.db
    module3.pom
        target/clover/module3Clover.db
    plkModule


I want to merge all 3 modules clover dbs in to one db in PlkModule and have a report(test coverage report) ,
How to do this? Could you please advice?

 

Regards

Raveendra

1 answer

0 votes

Hi Raveendra,

We do this in a couple of our projects and it is not too tricky.

The aggregate goal will merge all of the moduleXClover.DB into a single db and then you can use the clover task to generate the report.

For example, if running locally, and you have the open-clover plugin specified in your pom.xml  you can run:

mvn clover:setup test clover:aggregate clover:clover

The final "clover:clover" instruction will generage a report based on the merged database, which I think is the second part of your question.

Once it is working locally you can incorporate it in your bamboo build by exposing the report as an artifact and selecting "I already integrated a code coverage tool in this job." and putting in the path to the report.

Dear Richard

 

Thank you very much for your answer..!!!

 

Now I am getting "

'has 2 candidates, please provide a classifier.'

for one of a module.. Please advice.

"

Could you please advice , when giving maven goals as pom configuration, I am providing goals in my pom as "instrument,aggregate,clover,"

 

Please find below pom file...

<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>clover-maven-plugin</artifactId>

<configuration>

</configuration>
<executions>
<execution>
<phase>install</phase>
<!--<phase>pre-site</phase>-->
<goals>
<goal>instrument</goal>
<goal>aggregate</goal>
<goal>clover</goal>
</goals>
</execution>
</executions>
</plugin>

 

Regards

Raveendra

Hi Raveendra,

Unfortunately that's not an error I have seen before, and other than suggesting you use the newer open clover clover-maven-plugin,  I'm not sure what could be wrong with that configuration.

Thanks Richard for your reply!!.I  was able to generate coverage which is not much accurate form the below pom.


<plugin>
                <groupId>org.openclover</groupId>
                <artifactId>clover-maven-plugin</artifactId>
                <version>4.4.1</version>
                <configuration>
           
                    <flushPolicy>threaded</flushPolicy>
                    <flushInterval>30000</flushInterval>
                    <!--<includesTestSourceRoots>false</includesTestSourceRoots>-->
                </configuration>
                <executions>
                    <execution>
                        <phase>install</phase>
                        <!--<phase>pre-site</phase>-->
                        <goals>
                            <!--<goal>clean</goal>-->
                            <goal>instrument-test</goal>
                            <goal>aggregate</goal>
                            <goal>clover</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

But After I added exclusions Coverage become zero.Please find below pom after adding  excludes. Could you please advice?


<plugin>
<groupId>org.openclover</groupId>
<artifactId>clover-maven-plugin</artifactId>
<version>4.4.1</version>
<configuration>

<excludes>
<exclude>**/*_InternalTmp.java</exclude>
</excludes>
<flushPolicy>threaded</flushPolicy>
<flushInterval>30000</flushInterval>
<!--<includesTestSourceRoots>false</includesTestSourceRoots>-->
</configuration>
<executions>
<execution>
<phase>install</phase>
<!--<phase>pre-site</phase>-->
<goals>
<!--<goal>clean</goal>-->
<goal>instrument-test</goal>
<goal>aggregate</goal>
<goal>clover</goal>
</goals>
</execution>
</executions>
</plugin>

Regards

Raveendra

Hi again Raveendra,

I personally I would try the goals

- clean

- instrument (not instrument-test)

- aggregate

- clover

For testing I would remove the flush policy and flushInterval and just use the default settings. I am assuming you are just doing coverage for unit tests via surefire at the moment, not trying to get coverage for integration or functional tests?

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events