Clover's report for different tests

Hello, I need to separate my report to two linked reports (for JUnit and Distributed tests)

I create file for ant to use it in the maven.

<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="C:\root_cvs\test\azelentsov\clover_prototype_code_coverage\target\site\clover\clover1.xml" title="title1" summary="${summary}">
                <format refid="clover.format"/>
                <testsources dir="${tests}"/>
                <columns refid="clover.columns"/> 
        <fileset dir=""/>
           </current>
            <current outfile="${output}" title="title2" summary="${summary}">
                <format refid="clover.format"/>
                <testsources dir="${tests}"/>
                <columns refid="clover.columns"/>
        <fileset dir=""/>
            </current>
        </clover-report>
    </target>
 
  
</project>

What need me write here that I will get separated JUnit and Distributed test statistic?

1 answer

1 accepted

1 vote
Accepted answer

How do you have Clover instrumentation configured for your JUnit and Distributed tests? My suggestion is:

  • in order to have completely separate data, you shall have two independent sets of coverage recording files - so either to create two Clover databases (clover-junit.db + clover-distributed.db, for instance) or to have one Clover database but keep recording files separately (e.g. copy clover.db to different folder during test execution and set -Dclover.initstring.path property at runtime)
  • in order to have JUnits executed locally and Distributed ones with <distributedCoverage> option you have to either instrument code twice (using two profiles, for instance) or instrument once, but enable distributed coverage using runtime properties
  • then as you have two sets of coverage recording files, you can point to them in the <clover-report initstring="/path/to/clover.db"><current>...</current></clover-report> tasks in your report descriptor

See:

Cheers
Marek

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Dec 10, 2018 in Confluence

Organizing your space just got easier - Page Tree Drag & Drop is here

Hi Community! I’m Elaine, Confluence Product Manager. You may have read my earlier post about page tree in space navigation sidebar. I'm excited to share another improvement that helps you organize ...

201 views 6 7
Join discussion

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