1. Build the instrumented war file with
2. Deploy to remote server: war file, clover.db, and clover-idea-4.1.2.jar .
3. Add clover.db location to -Dinitstring and
clover-idea-4.1.2.jar to CLASSPATH
4 Restart web app
5. Run tests from regression-test, separate app run from Jenkins
No output files like
What am I missing?
I have looked at the doc pages:
the code runs, but does not report anything.
Please check the following:
1. Check if you indeed deployed an instrumented WAR file.
Mistakes do happen :) It is possible that you instrumented the code by Clover, but a WAR packaging task took original class files instead of instrumented ones. Check if you have *.class files named like
<base class name>$__CLR<some_hash>.class
inside the WAR. If they are present - you're good.
2. Check if Clover was able to find clover.db at runtime.
A wrong path to clover.db is a very common mistake. Because of the fact that your Jenkins workspace is located on a different machine (and folder) than your web application server, you must ensure that it found the clover.db at runtime. Open your application log / console output and look for Clover error messages. Example:
CLOVER: Unable to load the coverage database at <path>
CLOVER: No coverage data will be gathered.
3. Check if Clover did not fail because of other reasons.
[CLOVER] FATAL ERROR: Clover could not be initialised because it has insufficient security privileges.
Please consult the Clover documentation on the security policy file changes required.
The clover.jar not found on the classpath or in incorrect version:
[CLOVER] FATAL ERROR: Clover could not be initialised. Are you " +
"sure you have Clover in the runtime classpath?
[CLOVER] WARNING: The Clover version used in instrumentation does " +
"not match the runtime version. You need to run instrumented classes against the same version of Clover " +
"that you instrumented with.
4. Check if you copied all clover.db databases to your target machine or ensure that only one clover.db is created.
This applies mainly to Maven builds. By default Clover produces clover.db file for every Maven module. In such case I'd advise to use singleCloverDatabase parameter or use an absolute path in cloverDatabase parameter (it will cause that all modules will write to the same db). This way you will have to copy just one file to your web server.
5. Ensure that Clover's Distirbuted Coverage feature is enabled.
This applies when you want to collect per-test coverage data (I asssume that yes) and that unit tests are launched on your Jenkins server and they call business logic on your running web application server.
See https://confluence.atlassian.com/clover/using-distributed-per-test-coverage-184025273.html article how to do this.
I hope this helps.
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...
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