How to get Clover results through REST API

Timothy Calderwood August 15, 2017

 I am having lots of success using the REST API for the metrics I need to generate except for one key piece. I need to get the CLOVER results from the REST API. However, I cannot find any documentation on this and Google has not been useful at all. At a minimum, we need to get the Total Coverage information. Any help is greatly appreciated.

1 answer

0 votes
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 15, 2017

Hi Timothy,

I assume that you're referring to Bamboo REST API. 

Clover publishes several metrics as metadata properties for a build result, named:

CLOVER_BUILD_COVERAGE

CLOVER_LOC

CLOVER_NCLOC

 

You can fetch these values via build result REST endpoint:

GET /result/{projectKey}-{buildKey}/{buildNumber}

See more details here:

https://docs.atlassian.com/bamboo/REST/6.1.1/#d2e2333 

Prashanth TK August 29, 2020

I expanded my build get api result metadata as below and no Clover statistics are shown. How do I get  clover stats as a json response ?

 

<metadata start-index="0" max-result="10" size="10"><item key="buildTimeStamp" value="2020-08-29T12:35:40.400+05:30"/><item key="ManualBuildTriggerReason.userName" value="prash"/><item key="tmp.directory" value="E:\Softwares\bamboo-home\temp"/><item key="bamboo.system.getTestsToPass" value=""/><item key="working.directory" value="E:\Softwares\bamboo-home\xml-data\build-dir\TKLOG-TKLOG-JOB1"/><item key="buildKey" value="TKLOG-TKLOG-JOB1"/><item key="build.working.directory" value="E:\Softwares\bamboo-home\xml-data\build-dir\TKLOG-TKLOG-JOB1"/><item key="hg.cache.directory" value="E:\Softwares\bamboo-home\xml-data\build-dir\_hg-repositories-cache"/><item key="buildNumber" value="3"/><item key="git.cache.directory" value="E:\Softwares\bamboo-home\xml-data\build-dir\_git-repositories-cache"/></metadata>

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 31, 2020

Do you see Clover's statistics in Bamboo UI? Did you build with Clover succeed? Do you see clover.xml coverage file generated by Clover?

Prashanth TK September 1, 2020

I see the clover.xml locally. I have manually configured the plugin for openclover in my pom.xml. I'm not seeing the Clover tab or the Clover metadata in the build log rest API call.

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

Select the 'I already integrated a code coverage tool in this job' and provide path to your clover.xml file. See https://confluence.atlassian.com/bamboo/enabling-clover-for-bamboo-289277268.html 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events