Using Clover together with Bamboo Stages

Jan Swaelens
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.
March 20, 2012

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 votes
Answer accepted
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 24, 2012

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

Jan Swaelens
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 12, 2012

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

Jan Swaelens
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 23, 2012

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?

PiotrA
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 23, 2012

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

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

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

Jan Swaelens
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 23, 2012

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

Jan Swaelens
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 23, 2012

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

Jan Swaelens
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 23, 2012

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?

Jan Swaelens
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 24, 2012

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

PiotrA
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, 2012

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?)

Jan Swaelens
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, 2012

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

Atlassian Community Events