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

Deploy build only if code coverage is above threshold

Aviram Gabay
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 25, 2015

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

1 vote
Answer accepted
Grzegorz Lewandowski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 26, 2015

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

Aviram Gabay
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 26, 2015

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

 

Grzegorz Lewandowski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 26, 2015

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.

Aviram Gabay
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 26, 2015

I will try it! thanks!

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 26, 2015

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
TAGS
AUG Leaders

Atlassian Community Events