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

Clover's report: Distrebuted and unit tests

alex z October 25, 2012

Hello, how can i to differentiate UTest to Integration (distributed) tests in the html report?

2 answers

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 28, 2012

I'm not sure what you'd like to achieve exactly - separate tabs for "Tests" and "Integration tests"? separate html reports? code coverage calculated separately for normal and distributed run?

If you'd like to have two reports - one with unit tests and one with integration tests and both using the same coverage data, then please have a look at the <clover-report> task:

http://confluence.atlassian.com/display/CLOVER/clover-report

You can define multiple <current> elements with different <fileset> settings, reports will be linked with each other (link will be present in top-left frame below the "Test Results").

Regards
Marek

alex z October 28, 2012

I would like to separate tabs for "Tests" and "Integration tests"(It is best of all) or separate html reports

I uses clover-maven plagin for generating reports, how I can do it by mvn command?

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 28, 2012

Two tabs - not possible. But two linked reports - yes. In case of Maven build - for the clover2:clover configure a <reportDescriptor> option and point to location of the special report descriptor file. This file should be an Ant build file with two targets named "historical" and "current". In these targets you can define standard clover-report tasks. You can also have an access to few maven pom.xml settings by predefined Ant properties (like ${output}, ${cloverdb}).

Please have a look at the default-clover-report.xml file inside the maven-clover2-plugin-X.X.X.jar for reference.

See:

Regards
Marek

0 votes
alex z October 28, 2012

Thanks for Your answer!

But i don't understand how it implemented, for example: i have 1 java class App.java and Junit test class AppTest.java, and some distributed tests, i created xml file with 2 "current" tags:

&lt;project name="Clover Report" default="current"&gt;
 
    &lt;clover-format id="clover.format" type="${type}" orderBy="${orderBy}" filter="${filter}"/&gt;
    &lt;clover-setup initString="${cloverdb}"/&gt;
 
    &lt;clover-columns id="clover.columns"&gt;
        &lt;totalChildren/&gt;
        &lt;avgMethodComplexity/&gt;
        &lt;uncoveredElements format="raw"/&gt;
        &lt;totalPercentageCovered format="longbar"/&gt;
    &lt;/clover-columns&gt;
 
 
    &lt;target name="historical"&gt;
        &lt;clover-report&gt;
            &lt;current outfile="${output}"  summary="${summary}"&gt;
                &lt;format refid="clover.format"/&gt;
                &lt;testsources dir="${tests}"/&gt;
                &lt;columns refid="clover.columns"/&gt;
            &lt;/current&gt;
            &lt;historical outfile="${historyout}" historydir="${history}"&gt;
                &lt;format refid="clover.format"/&gt;
                &lt;columns refid="clover.columns"/&gt;
            &lt;/historical&gt;
        &lt;/clover-report&gt;
    &lt;/target&gt;
 
    &lt;target name="current"&gt;
        &lt;clover-report&gt;
            &lt;current outfile="C:\root_cvs\test\azelentsov\clover_prototype_code_coverage\target\site\clover\clover1.xml" title="title1" summary="${summary}"&gt;
                &lt;format refid="clover.format"/&gt;
                &lt;testsources dir="${tests}"/&gt;
                &lt;columns refid="clover.columns"/&gt;	
		&lt;fileset dir=""/&gt;
           &lt;/current&gt;
            &lt;current outfile="${output}" title="title2" summary="${summary}"&gt;
                &lt;format refid="clover.format"/&gt;
                &lt;testsources dir="${tests}"/&gt;
                &lt;columns refid="clover.columns"/&gt;
		&lt;fileset dir=""/&gt;
            &lt;/current&gt;
        &lt;/clover-report&gt;
    &lt;/target&gt;

 
&lt;/project&gt;



What should I write in this file that i can see statistics for my junit tests and for distributed tests?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events