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

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in Teamwork

What teamwork quotes inspire you?

Hey everyone! My name is Natalie and I'm an editor of the Atlassian Blog and I've got a question for you: What's your favorite quote about teamwork?  We've compiled a list here, along with...

142 views 16 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