Getting clover to use showUniqueCoverage in XML report

I want to have per-test coverage information included in the XML report produced by clover. As it stands, I have a custom report descriptor that looks like:

<project name="Clover Report" default="current">
 
    <clover-format id="clover.format" type="${type}" orderBy="${orderBy}" filter="${filter}"/>
    <clover-setup initString="${cloverdb}"/>
 
    <clover-columns id="clover.columns">
        <totalChildren/>
        <avgMethodComplexity/>
        <uncoveredElements format="raw"/>
        <totalPercentageCovered format="longbar"/>
    </clover-columns>
 
 
    <target name="historical">
        <clover-report>
            <current outfile="${output}"  summary="${summary}" >
                <format refid="clover.format"/>
                <testsources dir="${tests}"/>
                <columns refid="clover.columns"/>
            </current>
            <historical outfile="${historyout}" historydir="${history}">
                <format refid="clover.format"/>
                <columns refid="clover.columns"/>
            </historical>
        </clover-report>
    </target>
 
    <target name="current">
        <clover-report>
            <current outfile="${output}" title="${title}" summary="${summary}" showUniqueCoverage="true">
                <format refid="clover.format"/>
                <testsources dir="${tests}"/>
                <columns refid="clover.columns"/>
            </current>
        </clover-report>
    </target>
</project>

I build this with Maven:

mvn clean clover2:setup test clover2:clover

And it executes fine, but I do not see any per-test coverage information in the resulting XML. My POM looks like:

<plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-clover2-plugin</artifactId>
                <version>3.1.12</version>
                <configuration>
                    <generatePdf>false</generatePdf>
                    <generateXml>true</generateXml>
                    <generateHtml>false</generateHtml>
                    <reportDescriptor>clover-report.xml</reportDescriptor>
                </configuration>
            </plugin>

Any suggestions would be appreciated. Thanks.

As a further clarification: what I want is to see in the XML report is information about per-test coverage. Either by showing the tests that hit a given line of code, or what lines a given test executes (both are acceptable).

3 answers

1 accepted

This widget could not be displayed.

And it looks like this is not possible with the XML report according to this answer:

https://answers.atlassian.com/questions/40544/xml-report-and-per-test-coverage

I've created a feature request in Clover's issue tracker:

https://jira.atlassian.com/browse/CLOV-1304

Please correct me if I'm wrong.

This widget could not be displayed.

As a further clarification: what I want is to see in the XML report is information about per-test coverage. Either by showing the tests that hit a given line of code, or what lines a given test executes (both are acceptable).

This widget could not be displayed.

True. It is not possible to show tests which cover particular line at the moment.

Thank you for the report.

Cheers,
Jacek

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published yesterday in Marketplace Apps

The 7 hacks of highly successful automation

...there's anything I've learnt from working, it's that people are lazy! No offense to anyone reading this, but it's true and we can all admit it. The easier you make something for someone, the more...

101 views 0 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