Deploy build only if code coverage is above threshold

Hi,

Is it possible to trigger a deploy job for a build only if the clover report shows above a certain percentage of coverage?

 

Thanks!

1 answer

1 accepted

This widget could not be displayed.

Hi, 

you could use targetPercentage option to fail the build and then stop deployment. Please refer to the documentation for more information:

 

Best regards,

Grzegorz Lewandowski

Thanks for the answer!

I've looked into the links you send and I don't understand how to configure it via Bamboo.
Do I need to have access to the server for that? Isn't there a way to do it from the Bamboo interface?

 

Thanks again

 

Ok, sorry I blindly assumed that you're using manual integration with Clover and that's probably not the case and you're using automatic one. Such settings, as you require, are not available in Bamboo Administration screens since it's Clover product configuration not a Bamboo one. I can't be sure here, but you're probably using Maven to build your project, am I right? In that case you'd have to configure manually Clover with your poms, please refer to the [docs |https://confluence.atlassian.com/display/CLOVER/Basic+usage] how to achieve this.

I will try it! thanks!

Shortly: 1) Add maven-clover2-plugin to your pom.xml. 2) Define <targetPercentage> option. 3) Maven task should run: clean clover2:setup test clover2:aggregate clover2:clover clover2:check (I assume that you'd like to see coverage reports as well) 4) In Bamboo you shall choose "Clover is already integrated into this build". 5) Your deployment task trigger shall depend on a successful build task.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

198 views 1 3
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