Clover for code coverage

Hi,

I configured bamboo and started using it to perform different project builds.

Our project manager want a way to track code churn and the number of lines of code for each build.

Would Clover be used to provide code coverage and report the lines of code changed for each build?

I downloaded a Clover trial license, but it seem that it supports :

Clover for IDEA - 3.1.6

Clover for Eclips - 3.1.6

Clover for Ant - 3.1.6

Cover for Maven 1

But we do not use any of these systems. We use legacy build systems such as Make and other custom build scripts to build our projects.

Can we use Clover to provides with code coverage?

Thank you,

Eman Jado

1 answer

0 votes

Hello Eman,

In order to use Clover with Bamboo and a legacy build system (e.g. make), you have to:

1) Instrument sources and compile them

Call the https://confluence.atlassian.com/display/CLOVER/CloverInstr command line tool from your makefile and put instrumented files into some temporary directory. Modify your javac command so that it will use instrumented sources instead of the original ones.

2) Get coverage data

Run your unit tests (or any other kind of test you have in your build). Coverage files will be written to the same directory where clover.db is stored (which is defined in point 1).

3) Generate Clover XML report

Use the https://confluence.atlassian.com/display/CLOVER/XmlReporter command line tool for this task. Store report in a directory accessible by Bamboo build.

These three tasks above can be done by make called from Bamboo task. Now you have to tell Bamboo where the XML report is located:

4) Integrate Clover with Bamboo

Open Job configuration. Find "Miscellanous" tab. On this tab, enable the "Use Clover to collect Code Coverage for this build" checkbox. For "Integration Options" choose "Clover is already integrated into this build and a clover.xml file will be produced" option. In the "Clover XML Location" edit field enter a path to your clover.xml report file (generated in point 3).

Now you should see the "Clover" tab on the Plan Summary page (two graphs) and the Build Summary page (last build statistics).

The CloverInstr and XmlReporter command line tools are available in clover.jar in Clover-for-Ant.

Regards
Marek

Suggest an answer

Log in or Sign up to answer
Community showcase
Published yesterday in Jira Ops

Jira Ops Early Access Program Update #1: Announcing our next feature and a new integration

Thanks for signing up for Jira Ops! I’m Matt Ryall, leader for the Jira Ops product team at Atlassian. Since this is a brand new product, we’ll be delivering improvements quickly and sharing updates...

246 views 0 6
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