Clover's report: Distrebuted and unit tests

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

2 answers

1 accepted

1 vote

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

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?

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

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
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
Fadoua M. Boualem
Published Monday in Trello

Using Trello to manage events

As a Jira power user, I was at first doubtful that Trello could benefit my workflow. Jira already uses boards (ones you can customize!), so why would I even need to use Trello?! In this post you will...

506 views 8 9
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