Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Clover's report for different tests

alex z October 29, 2012

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
Answer accepted
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 30, 2012

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
TAGS
AUG Leaders

Atlassian Community Events