How to clover html-report embed in bamboo

Christopher Dancy
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.
September 3, 2012

While it's easy enough to get clover to generate a detailed html-report (looks great by the way) via ant getting that same report displayed in bamboo is another story. All of the documentation online, as well as bamboo and clover plugin itself, say to generate an xml-report. However doing so and pointing to it is generating a very simple almost "summary" like report. I want bamboo to display and/or generate the html report that clover can easily generate in ant. Is this possible? Do I have to generate html-report in ant and collect the data as an artifact?

2 answers

1 accepted

1 vote
Answer accepted
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 5, 2012

If Bamboo Clover Plugin (no matter whether it's Bamboo 3.x or 4.x) finds HTML Report (*) artifact after build, then content of the "Job Summary" > "Clover" tab shows HTML report (as on Viewing+the+Clover+code-coverage+for+a+build).

If HTML Report artifact is not present, then Bamboo Clover Plugin searches for XML Report (clover.xml file). If found, the content of "Job Summary" > "Clover" shows basic report (as on 3.5+Viewing+Clover+Code-Coverage+for+a+Build+Result).

If XML Report is not available, then "Clover" tab is not visible.

Please note that there is no difference whether automatic or manual Clover integration is used.

(*) This artifact is by default named "Clover Report (System)", but it doesn't have to, because Clover plugin is using some simple heuristics and checks artifact content in order to determine whether it's an HTML report or not.

Regards
Marek

Christopher Dancy
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.
September 10, 2012

Ok this does work but takes a REALLY long time to generate the html report from the xml. If I generate the report, AOT via html-report task, then I get it instantly through the artifacts tab. Is there anyway to speed up the generation through bamboo (i.e. more memory/threads) or do you recommend doing it AOT via html-report ant task?

Christopher Dancy
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.
September 10, 2012

Gettig this to work correctly I had to have clover generate an xml report as well as an html-report. I had to turn clover on for specific job and point it at the xml report. I then had to create an artifact and point that at the generated html-report. This works as expected but seems a bit wonky. Is there something I'm missing?

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

Just to clarify: HTML report is not being generated from XML report; as a matter of fact, both reports are being generated using information from Clover database (clover.db) and coverage recordings (clover.dbHHHHHHH_TTTTTTTTTT). Bamboo does not create HTML report on its own (if you have automatic integration) - it just calls proper Clover tasks (Ant-based projects) or goals (Maven-based projects).

You've mentioned that report generation using <html-report/> task in Ant script is significantly faster than generating the same report using automatic Clover integration - am I correct? In such case it can be caused by different settings used in your Ant build.xml file compared to default Bamboo Clover Plugin settings.

Please also note that significantly longer build time can be actually caused by different targets executed during build (and not just html report generation). If you use automatic integration then full clean is made, for example.

Things you could check: does these two (from manual and automatic integration) HTML reports are identical (coverage values; number of tests executed; can you click on a left margin of a source line and see per-test coverage; etc)? do you generate also historical or JSON reports using automatic integration? compare build logs from manual and automatic integration - do you see the same list of targets being executed?

0 votes
Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 3, 2012

If you define the report as an artifact (I vaguely remember it gets defined automatically?), like this:

Clover HTML build/clover/ **/*.*

You will be able to access the HTML report from the artifacts tab via your web browser.

Christopher Dancy
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.
September 3, 2012

Yea that's what I'm doing now. I wanted something that looked like this:

https://confluence.atlassian.com/display/BAMBOO/Viewing+the+Clover+code-coverage+for+a+build

Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 3, 2012

Do you have an artifact called "Clover Report (System)" in your build?

Christopher Dancy
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.
September 3, 2012

Not exactly named that but yes. Having ant generate the html-report and viewing it through an artifact is working as expected. I think the issues may be bamboo verisons. We are currently using bamboo 3.4 and see output like the following:

https://confluence.atlassian.com/display/BAMBOO011/3.5+Viewing+Clover+Code-Coverage+for+a+Build+Result

However bamboo 4.x displays the output like so:

https://confluence.atlassian.com/display/BAMBOO/Viewing+the+Clover+code-coverage+for+a+build

Am I correct in assuming that bamboo 4.x will generate the html-report for me?

Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 3, 2012

It's Clover that generates the report. Bamboo should automatically hook it up (create the artifact etc.) - not sure about 3.4, but 4 definitely does it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events