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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do I get clover history when I can't maintain the same coverage databases from build to build?

I want to use the clover history feature, but I am building our product and running the regression tests on a CI server (TeamCity). We have about 30 different components, each with it's own clover DB. When the compile build starts, it downloads all our current source, then compiles it with ant, using the appropriate <clover-setup> ant tasks to gather coverage data in those different DBs. Then the regression tests run, and clover creates a bunch of reporting files. At the end, the CI server packages up all the coverage databases and report files, I then extract them on my PC and run the <clover-html> ant tasks to generate the HTML reports.

The problem is that the CI server builds on a completely empty system when it starts any compiles. There is no place to have it restore earlier coverage reports so that clover can update anything that already exists. I can hold on to older coverage databases and report files, but they would exist in completely separate directories for each run. I can't see how I can get <clover-html-report> to compare two completely separate sets of coverage files to generate a historical report. I looked at <clover-historypoint>, but that only allows me to choose a particular point in time as the starting point for historical comparisons. Since I can only pass it one init string, it seems that there is no way for me to tell it that I want to compare two different sets of databases.

How can I do this?

1 answer

1 accepted

1 vote
Answer accepted

Very good question. Actually, you have touched several topics:

1) Merging of dabases

You've mentioned that you have 30 different components, each with it's own clover.db. Please note that you can merge all these databases into one, which makes it very convenient for reporting as you can get a single report. See clover-merge task for details.

2) Files to be preserved between builds

In order to generate a historical report, you have to keep historys file only (clover-*.xml.gz) between builds. There is no need to keep clover databases (as they will be recreated during compilation).

3) Comparison of build results

Clover does not compare databases (*.db) to generate a historical report. Instead of this, it compares history points (*.xml). History point file contains metric information (like number of statments, test results etc). During report generation you can choose whether it should compare two last history points (default) or some longer period of time.

I would recommend a following approach:

1. Merge all components' clover.db files into one at the end of build in order to get a single database:

&lt;clover-merge initstring="${clover.merged.db}"&gt;
    &lt;cloverDb initstring="module-a/build/clover.db"/&gt;
    &lt;cloverDb initstring="module-b/build/clover.db"/&gt;
&lt;/clover-merge&gt;

2. Create a history point for a merged database:

&lt;clover-historypoint initstring="${clover.merged.db}" historyDir="${clover.history.dir}"/&gt;

3. Create a 'current' and 'historical' report for a project. Use the <clover-report> target instead of <clover-html-report/>, because it provides more options. Define a <movers> section with a time period which interests you (unless you wish to compare last two builds):

&lt;clover-report initstring="${clover.merged.db}"&gt;
    &lt;current outfile="${clover.report.dir}" title="Current status of my Project"/&gt;
    &lt;historical outfile="${clover.report.dir}" title="History of my Project"
        historyDir="${clover.history.dir}"&gt;
        &lt;overview/&gt;
        &lt;chart&gt;
            &lt;columns&gt;
                &lt;totalPercentageCovered/&gt;
            &lt;/columns&gt;
        &lt;/chart&gt;
        &lt;movers interval="30d"/&gt;
    &lt;/historical&gt;
&lt;/clover-report&gt;

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Jira Cloud Performance Improvements

Hello everyone, I am a product manager in the Jira Cloud team focused on making sure our customers have a delightful experience using our products. Towards that goal, one of the areas which is extr...

172 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you