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

Clover coverage metrics very slow

I just migrated from Jenkins to Bamboo 6.6.  My build and unit tests took about 20 minutes to complete on the previous Jenkins server.  It parsed the cobertura formatted xml file generated by gcovr, in under 30 seconds.  I added Bamboo tasks to:

  1. Run gcov on each file
  2. Generate a string containing every gcov file in the build.
  3. Run gcov_to_clover.py with the generated string as input.

This works, but is painfully slow, taking hours to run the gcov_to_clover.py script with all those files.  This is a little frustrating since the previous solution I was using parsed the coverage files in seconds.  For those that are using Bamboo for C/C++ projects, is this our only option?

1 answer

I'm not a strong python developer, so I'm not sure to optimize this.  But the bottleneck lies in line 405:

file_node.appendChild(line_node);

If I comment this line out, it obviously doesn't write all the correct data to the xml file, but execution time goes from hours to about 20 seconds.  

Jeyanthan I Atlassian Team Jul 02, 2018

Hi Mathew,

Did you try running the same in the respective Bamboo agent's command prompt (outside Bamboo)?

If you experience same slowness, it is likely that the issue is not on the Bamboo side.

Yes.  It is not on the bamboo side.  I didn’t expect that it was.  The appendChild function scales poorly as the container grows.  With a code base with hundreds of thousands of SLOC, that function gets called hundreds of thousands of times.  I abandoned trying to make that python script work and found another script created by somebody else.  This new script performs an XSLT transform from the cobertura XML output of gcovr to the clover XML format.  That script takes about 5 seconds to complete.  So I can collect coverage metrics in about 30 seconds again.

I knew the problem was in the python script.  It’s just that was the only recommended way to show c/c++ metrics that I could find here on the Atlassian boards.  Clover seems to work great on java projects using the maven and ant build systems.  I was frustrated thinking I might be the only one using Bamboo on c/c++ projects using cmake/ctest.

I did eventually get it to work, though I’m not really sure how clover integration benefits the project.  It only shows a single summary metric.  I ended up having to use gcovr to generate the detailed html reports anyway.  Independent of clover.  Bamboo has nice integration into the ctest test results, letting me easily submit jira tickets on new issues.  There doesn’t seem to be a way to apply a pass/fail coverage threshold, or submit tickets when the minimum coverage is not met.

Jeyanthan I Atlassian Team Jul 11, 2018

Sure. You may check for existing feature requests and create one if need be here: https://jira.atlassian.com/projects/CLOV/issues/

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 ...

195 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