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

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

127 views 0 5
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