How can Clover be configured, via maven build running in Bamboo, to instrument and report on only changed files?

I'm working in a large, legacy project that does not have good code coverage, but I want to require the development team to have a certain level of code coverage for any classes that they touch or create. How can maven/clover/bamboo be used to report percent code covered only on classes changed since the last successful build, and fail the build if the code coverage goal is not acheived?

Currently using Bamboo 3, Maven 2

1 answer

1 accepted

0 votes
Accepted answer

Unfortunately such feature is not available. One of the reasons is that Bamboo can run builds using multiple agents, each of them checking out/updating source code when necessary - and you never know which agent will be used for build and thus how many files will be updated. Another reason is that our experience shows that such kind of report is not very reliable, because number of executed test classes and number of business classes in scope and thus coverage threshold varies very much from one commit to another. It's much better to have relatively stable set of classes in scope.

Instead of this, I recommend using the historical report feature, which will report about new classes since the last Clover run, show classes for which coverage has changed as well as present general trends in coverage on graphs.

Alternatively, you might consider limiting set of files for instrumentation to those being under active development. A Maven clover2:setup goal with includes/excludes options can be used for this purpose. See clover2:setup mojo reference. A list of files can be prepared manually or based on svn log, for example.

Suggest an answer

Log in or Sign up to answer
Community showcase

Scrum Roles Explained: the Do's and the Don'ts

Hello Community,  Today we are going to talk about the three Scrum Roles. There is the Development Team, the Scrum Master and the Product Owner. In my opinion these three are all really impo...

99 views 0 4
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