Issue Details (XML | Word | Printable)

Key: MPCLOVER-35
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vincent Massol
Reporter: Eric Lapierre
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Maven 1.x Clover Plugin

projects that don't have clover data does not produce reports

Created: 07/Apr/05 04:30 PM   Updated: 30/May/05 02:24 AM   Resolved: 22/Apr/05 02:20 PM
Return to search
Component/s: None
Affects Version/s: 1.8
Fix Version/s: 1.9

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive clover_patch.zip (0.7 kB)



 Description  « Hide

Some projects have java code but does not have any testcases, so the coverage is 0% and the number of line is != 0. However, because there was no coverage data collected, no clover report is generated.

We therefore don't see the number of line of java code in the dashboard report when there are no junit testcases for that project.

Clover provides a flag to generate the reports even though there is not coverage data.

alwaysReport="true"



Vincent Massol added a comment - 22/Apr/05 12:59 PM

Hi Eric,

Thanks for the idea. I've started implementing it but the problem is that the report will fail if there is no coverage database, even when alwaysReport is set to "true"! How do I create an empty coverage database?

Thanks


Vincent Massol made changes - 22/Apr/05 12:59 PM
Field Original Value New Value
Assignee Vincent Massol [ vmassol ]
Eric Lapierre added a comment - 22/Apr/05 01:15 PM

As long as the ${maven.clover.database.dir}/clover_coverage.db exists, the report should be generated with the alwaysReport="true" flag even if the files${maven.clover.database.dir}/clover_coverage.dbxxxx_xxxxxxxxx are not there. It works for me with clover 1.3.4.

If the ${maven.clover.database.dir}/clover_coverage.db does not exist, the report should not be generated. This is already the behavior of the plugin.


Vincent Massol added a comment - 22/Apr/05 01:38 PM

Let me say it differently: the clover_coverage.db file usually exists only when the tests are executed. So if there are no tests no clover db file will be generated and thus no report will get generated either...

The only situation where it would work is in the case of a multi-project where you would share the clover db. The first project would create it. Of course if this first project does not have any test, it won't be created and thus it won't work.


Eric Lapierre added a comment - 22/Apr/05 01:43 PM

The {maven.clover.database.dir}/clover_coverage.db is created when you compile your code with clover.

The ${maven.clover.database.dir}/clover_coverage.dbxxxx_xxxxxxxxx are created when the tests are executed.


Vincent Massol added a comment - 22/Apr/05 02:09 PM

ok, I understand why it was not working. We only call test:test (which in turn calls java:compile) if there are tests. Thus the db file is never created... I'm working on it...


Vincent Massol added a comment - 22/Apr/05 02:20 PM

I've implemented this feature. Oops I've just realized that you had provided a patch (I had missed it). I've had a quick look and it seems it was missing several things:

  • no support for calling java:compile and java:jar-resources
  • no tests

Thanks anyway. If I had seen, it earlier I would have asked you for some tests!

-Vincent


Vincent Massol made changes - 22/Apr/05 02:20 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]
Fix Version/s 1.9 [ 11530 ]
Julien Kirch added a comment - 30/May/05 02:24 AM

As a consequences, when we have no test case the clover report is generated and the link to it added to the site (linking to a page with no usable data at all, changing the MPCLOVER-21 bahavior), if the report generation is not a requesdite, would it be possible to at least remove the link ?