Using Clover together with Bamboo Stages

I am planning to create a test plan where I first build out sources, deploy the artefacts to a server and then run tests on that server.

Since our set-up is already using 3 stages to do this, I would like to keep it that way when I make the step to use Clover.

Reading the documentation it is suggested to do this:

with.clover your.test.target clover.report

How does this factor in with Bamboo Stages?
Do I need to repeat the with.clover for each stage or will that confuse clover?

thanks

1 answer

1 accepted

0 vote

Assuming that you use Bamboo with Ant build and have following three stages:

  1. run build
  2. deploy to server
  3. run tests on server

I would recommend use of Clover tasks inside your own targets, instead of high-level Clover predefined targets. In such case:

ad 1. Add <clover-setup/> or <clover-instr/> to your build target.

ad 2. Deploy instrumented code and clover.jar to your server.

ad 3. Add <clover-report/> task to your test target, providing license key and clover.initstring as well.

See Working+with+Distributed+Applications

Thanks (just noticed your post), I'll sure give that approach a try!

Allright, almost there! I got the instrumentation and tests running as they should, now I am proceeding to get the report generated to be displayed in bamboo.

I added another stage to my plan which will take care of the report generation, very similar to what is configured here http://blogs.atlassian.com/2012/07/bamboo-maven-clover-aggregated-code-coverage.

However, it doesn't seem to be triggered because some of the jobs in the test stage are failing (due to failed tests). Do I understand correctly that I can only have the last stage executed when all previous stages have completed successfully?
This would be quite a restriction since we always have one or two test failing ...

Could I get by this in some way?

How about quarantining the failed tests? (Quarantining the tests is a feature we had added in 4.0 or 4.1)... Shall I find you a relevant documentation for it (I'm not sure if you know what am I talking about)...

Quarantining is a very good idea. Alternatively, you could use a single stage with a job in which the Clover reporting task is put on the list of "Final Tasks" (they are always executed at the end of the build, no matter whether previous tasks has failed or not).

Yeah I know that feature, pretty cool actually. It would be a workaround indeed.

Ah that's even better! Didn't know that one! Thanks.

Allright, the clover.xml is produced nicely and sizes around 80MB.

It seems that the Clover plugin is chocking on the size though, it is giving a 'Failed to execute plugin 'Clover Results Collector' with error: GC overhead limit exceeded' line in the build log.

Should I just be generating an HTML report and adding that as artefact? I can imagine that the cheer amount of data might slow down the UI even if it gets processed properly?

Bad news, having the final stage with a final task doesn't seem to work. It is still not executing the stage because a previous stage has failed ...

Hello Jan,

I think the idea with using "Final Task" is to - somehow - put the Job that take care of the report generation into the failing stage, not into some additional Final Stage. Not sure if this is feasible at all - it depends on your plan structure (how many 'casual' jobs do you have in the failing stage? more than one?)

Hello,

Yeah we have 4 jobs in the 'test' stage - some of them also need to run on remote agents. The amount of time spent in total would also become too long, we need them split up to be able to run async.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Fadoua M. Boualem
Published Monday in Trello

Using Trello to manage events

As a Jira power user, I was at first doubtful that Trello could benefit my workflow. Jira already uses boards (ones you can customize!), so why would I even need to use Trello?! In this post you will...

476 views 7 8
Read article

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