Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

question about Example 3 in the "Using Clover in various environment" page

will zhang August 25, 2016

Hi,

 

A clover question:

I'm trying to collect code coverage result from our system test framework. I found the example 3( or 3b) matches my scenarios on this page: https://confluence.atlassian.com/display/CLOVER/Using+Clover+in+various+environment+configurations#UsingCloverinvariousenvironmentconfigurations-Example#3-multipleapplicationsexecutedonseveralserversinisolation

 

I'm confused about this line "As every application runs in their own JVM and due to fact that we have used cloverDatabase (and optionally singleCloverDatabase) pointing to absolute path on a network drive, we don't need to provide clover.initstring parameter at runtime, because correct path is hardcoded in instrumented classes."

Where does the "correct path" of clover.db stored? Hardcoded in the instrumented classes?

If that's the case, does that mean 2 clover instrumented apps can run on the same JVM and we can collect the code coverage data without a problem? Assuming I put the clover.db files into the same path as it was in the build machine?

 

Thanks in advance,

Will

 

 

 

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.
August 25, 2016

Hi Will,

Where does the "correct path" of clover.db stored? Hardcoded in the instrumented classes?

Yes, Clover stores a path to a database file in every class instrumented (more precisely - in every top-level class, for anonymous classes or inner classes it uses a path from the enclosing class).

 

If that's the case, does that mean 2 clover instrumented apps can run on the same JVM and we can collect the code coverage data without a problem?

Yes, in a single JVM you can run multiple applications or application modules with different paths to clover.db. 

 

Assuming I put the clover.db files into the same path as it was in the build machine?

Yes, in case you used an absolute path in initstring, then you have to store clover.db files in the same location.

You can either copy them from a build machine to a test machine (e.g. tar -cf clover.db.tar `find . -name clover.db`; scp clover.db.tar ...) or use a network drive.

 

Alternatively, you can use a relative path and use -Dclover.initstring or -Dclover.initstring.basedir property on a test machine.

 

Regards
Marek 

will zhang August 26, 2016

Thanks for the help!

 

1 vote
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 25, 2016

PS: Please have a look also at Example #4 from the page you linked - I guess you may be interested in having per-test code coverage in reports. Also have a look at this tutorial: Working+with+Distributed+Applications - it shows a standard setup.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events