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 coverage records after deploying and running the application?

Hello All,

We have a standalone application deployed on a different machine and the application jar (excluding the dependent jars) is instrumented using gradle.

We call the ant.clean followed by setup and then use javac to compile and the gradle nebula.rpm plugin to create an RPM.

This RPM is then deployed on a different machine where the clover.db file is copied and the path is set as JVM argument using -Dclover.initstring=path/to/clover.db.

However, when we run the tests, we see no coverage data in the path where clover.db is located(supplied via the init string)

We are not able to get any clover logs even after setting the JVM arguments for the same in order to debug and our application logs do not indicate any exceptions.

Steps ensured -

1. clean is called before setup task and then followed by compilation.(all done through gradle's ant builder)

2. Generated jar file was exploded and the resulting class files were decompiled to make sure that they were instrumented.

3. clover.jar is in the classpath of the application when we run the application(included the same under lib directory and also made sure that this path is made available using -classpath java option)

4. Init String is provided to the JVM as an argument at runtime.

 

Can anyone help us proceed further? If anyone can help provide information regarding how to generate clover logs, it would be help to debug this further from our end.

 

 

2 answers

0 votes

The only thing which come to my mind is the fact that coverage data might not be flushed to hard drive. How do you stop an application JVM  with Clover ?

Note it needs to be gracefully shutdown (e.g by kill -15) otherwise parts or all coverage data will be lost.  (Clover uses JVM shutdown hook and when JVM is killed those aren't invoked at all)

https://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html#addShutdownHook(java.lang.Thread)

Beside that and the steps you've already mentioned I don't have any ideas why Clover might not work properly. But I don't know what exactly does it mean to package classes to RPM file and deploy it to JVM. (I don't know how to run RPM package in JVM). That solution might not work with Clover. 

You can also change a flush policy to "interval" or "threaded".

 

Using Ant: 

<clover-setup flushPolicy="interval" flushInterval="500">
<clover-instr flushPolicy="interval" flushInterval="500">

 

Using Maven:

<configuration>
  <flushPolicy>interval</flushPolicy>
<flushInterval>500</flushInterval>
</configuration>

 

References:

 

Cheers

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...

178 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