Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Fail build if code coverage less than limit

Hi Team,

 

We are using following tool for CICD. We would like to know how to fail build if coverage is less than limit. In the build plan we have added task for sonar and dotcover.

 

Bamboo - 5.14.5

SonarScanner for MSBuild 4.3.1

JetBrains dotCover Console Runner 2018.1.4. Build 112.0.20180731.145946

nunit-2.6.4

BitBucket

 

Thank you,

Suresh Kumar G

1 answer

0 votes

You could use targetPercentage option to fail the build and then stop deployment.

Such settings, as you request, are not available in Bamboo Administration UI since this feature-set is part of Clover product configuration. You could e.g. combine Clover with Maven to build your project.

For deployment, as I understand you want to perform, you could do the following:

(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 (so to see coverage reports as well) (4) In Bamboo you can now choose "Clover is already integrated into this build" (5) Your deployment task trigger shall depend on a successful build task

Please refer to the below documentation for more information:

As the second article shows, Clover combines also with Ant. I found nothing for MSBuild.

Nonetheless, hope this helps.

Cheers, Gerhard

Hi Gerhard,

 

Thank you for reply. We are looking for option to make the build failure in MSBuild. For now we are enabling the notification alone from SonarQube if quality going down. 

 

Thank you,

Suresh Kumar G

Hi Gerhard,

 

Will the plugin https://marketplace.atlassian.com/apps/1212756/sonar-for-bamboo?hosting=server&tab=overview help me in this ? To fail the build.

 

Thank you,

Suresh Kumar G

Hi Suresh,

I cannot tell you with certainty, but from I read in its description, I believe it should - it's written: Includes a build breaker functionality to fail the build if the configured SonarQube quality gates fail.

I'd assume that code coverage is one of various possible quality gates.

I suggest to try it for free for a while and check exactly this. Please be aware that this plugin comes with an extra cost, not covered by your Bamboo license as it's a Third Party plugin.

Please let us know if it's your perfect hit!

Thanks, Gerhard

Hi Gerhard,

 

Thank you. We will try this and check it out.

 

Thank you,

Suresh Kumar G

You're most welcome.

Let Community know how it goes, so it might be a great reference for others to.

Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

179 views 4 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you