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

[clover-html-report] No coverage recordings found. No report will be generated.

I am using clover with ant to generate coverage reports to an existing java project that already has unit test cases.

My ant target first runs clover-setup then builds the code using javac and then runs the tests using junit. I have added clover.jar to the runtime classpath for the test cases.

When i run the build target i see clover logs saying that classes have been instrumented

[clover] Clover all over. Instrumented 28 files (3 packages).

However when i run the <clover-html-report> task no report is generated. Instead the log shows

[clover-html-report] No coverage recordings found. No report will be generated.

If code coverage is being collected/logged what log messages am i expected to see when junit is executing?

1 answer

1 accepted

0 votes
Answer accepted

1) Please check in which order your targets are being called. A common mistake is to call <javac> first, followed by <clover-setup>. As a consequence, sources are instrumented, but not compiled. Assuming that you're using Clover-for-Ant, a typical sequence is:

  • clean (to ensure all sources will be recompiled)
  • instrument sources (<clover-setup> or <clover-instr>)
  • compile (<javac>)
  • test (<junit> or other)
  • reporting (<clover-report> or <clover-html-report>

2) Please double check if the clover.jar is on the classpath. In case it's missing you may find "NoClassDefFoundError" exceptions in the junit log.

3) Please check if clover.db is accessible by your application during test execution. It may happen that instrumented classes cannot find the database, especially when unit tests are ran from a working directory different than the build directory or on another machine.

In such case you shall find warning messages in the junit log about it.

How to fix it? You can:

* use an absolute path in <clover-setup initstring="..."> or

* run unit tests from the same working directory as build or

* copy clover.db to a proper location/machine and pass -Dclover.initstring=/path/to/clover.db JVM property

4) Please check what flush policy do you have in <clover-setup> set. You may change the default setting in case you're running your code on an application server.

The problem was that clover.jar was not on the classpath.

I had used a <classpath refid=""> in my junit task but that did not seem to work. If use the

&lt;classpath&gt;

	&lt;pathelement location=""/&gt;

&lt;/classpath&gt;

mechanism, then it works fine.

Thank you for your help

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

171 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