Why doesn't Clover always report code coverage for my Java web app?

1k views Asked by At

I am using clover code coverage for finding the code coverage. I have instrumented my code and placed it as dependency in my web project.

Sometimes my clover db gets updated sometimes it does not. Why? Is there any bug in Clover tool?

I am using Clover and my code is in Java.

Sometimes I see separate file created in the directory where my cloverdb is placed. Sometimes those files are not created. At what interval those files are created?

2

There are 2 answers

2
Paul On

Clover only runs tests on code that has changed since the last time tests were run. See this post on Clover's test optimization.

Have you changed code under test? It could be that when the db is not updated you haven't changed any code that there are tests for.

0
Marek On

Sometimes I see separate file created in the directory where my cloverdb is placed. Sometimes those files are not created. At what interval those files are created?

You mentioned that you have a web project. In case when project runs on an application server and you don't have the 'threaded' or 'interval' flush policy set and you don't shut down the server at the end of tests, then the coverage file will not be produced, because by default it happens at the JVM termination.

See: