Can coverage.db file be located on a remote host??


I have the following scenario.

  • Devloper's source codes are located in Machine1, together which coverage.db file
  • Instrumented/cloverized jars of the same codes are located(copied to) on another remote Machine2

I execute tests, which uses/calls instrumnted jar's classes methods which are located on Machine2

Is it possible to give the <cloverDatabase>C:\coverage.db</cloverDatabase> path in pom.xml of delvopers' projects' pom xmls with host IP, for example http://{machine1_IP}/coverage.db, so the results of methods calls could be recorded in coverage.db file which is located on Machine1.

If it is possible, can you please tell me, how can it be done?

Thanks in advance,


2 answers

0 votes

Hi Sevak,

It's not possible to use an URL for the <cloverDatabase>. However, I don't think that you actually need such feature at all.

From what you wrote, three scenarios come into my mind. I'm not sure which one (or maybe all?) fits your needs:

Scenario 1: separation of compilation, testing and reporting.

It's perfectly fine to run compilation (mvn clover2:setup compile/compileTest) on one machine, next to run tests (mvn test/verify) on another machine (or a number of machines, like agents in Bamboo) and next collect all coverage results from tests machines and run reporting (mvn clover2:clover) on yet another machine.

The only thing you have to take care about in such scenario is to copy clover.db and coverage recording files to proper machines / locations. You can use maven-antrun-plugin for this purpose, for instance.

Scenario 2: separation of application and test code execution.

Clover supports also a Distributed Coverage feature. It means that, for instance you can launch your unit tests from one machine (typically, it's a build server) and these units tests will call application logic running on another machines (typically, it's a test machine with an application server running on it). Clover is able to not only record global coverage, but also to track per-test coverage in such distirbuted environment.

Again, it's necessary to provide clover.db for test execution and to collect coverage recording files (from test machines) into a single place for report generation.

Scenario 3: separation of projects and modules during compilation.

What I have in mind is that you can compile every project or module separately, having a separate clover.db for each of them. It's perfectly OK to run such separately instrumented modules together - not only on the same machine, but also in the same JVM - each instrumented class will report coverage to the database it was instrumented with.

I recommend a following lecture:

One side note. You wrote:

so the results of methods calls could be recorded in coverage.db file

Coverage results are not being written to the clover.db file. A database does not change during test execution. Clover will create new coverage recording files aside the DB file. They're named like:

  • clover.dbsomehashcode, clover.dbsomehashcode.1 - for global coverage
  • clover.dbsomelongerhashcode.s - for per-test coverage


Thank you for your detailed answer

Let me decribe our scenario in details.

  1. I have DEV sources and QE tests sources in Machine_A
  2. I have Instrumented DEV codes
  3. Moved instrumented jars from Machine_A ->Machine_B (so I moved only instrumented jars, not the source codes - .java files. So when I move the jars to Machine_B, I guess that mapping between dev sources(not jars) and coverage.db is lost),
  4. coverage.db still located on Machine_A
  5. I have instrumented also QE codes in the same machine_A
  6. Running the QE tests from Machine_A, it will run on DEV instrumented jars located on Machine_B

What I try to explain is that DEV instrumented jars(containing .classes) are located on one machine_B, meanwhile DEV sources(.java) are located on another machine_A.

In instrumented jars, there is information about the path of code sources, right?

In my case this path will be broken since after instrumentation, I moved jars to another machine.

And in order the report to be generated, source codes(.java) files' location path is necessary.

In this situation how can I deal?


The most important thing is that you need to copy clover.db together with jars. When you execute instrumented code it requires access to clover.db (access to sources is not necessary).

Also when you genere report, you may disable acess to source code or configure a different path. For some more details see:


0 votes

It's a great question! Thanks for asking it.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Wednesday in Opsgenie

Getting the Most out of Atlassian and Opsgenie Together

We’re excited to invite you to this action-packed webinar where we will demonstrate how to integrate Opsgenie’s powerful alerting and on-call management tools with your entire Atlassian stack. Mar...

66 views 0 1
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