Issue Details (XML | Word | Printable)

Key: MPCLOVER-18
Type: Wish Wish
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Vincent Massol
Reporter: Matt Read
Votes: 1
Watchers: 2
Operations

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

Stop Clover re-running tests if they've already run

Created: 25/Jun/04 01:00 PM   Updated: 11/Feb/05 10:52 AM   Resolved: 11/Feb/05 10:52 AM
Return to search
Component/s: None
Affects Version/s: 1.6
Fix Version/s: 1.7

Time Tracking:
Not Specified


 Description  « Hide

If both the junit-report and clover-report are registered the tests execute twice. Would it be possible to either provide a setting to disable this or detect whether tests have already been run?

This might be similar to the property in the Cactus plugin - cactus.execute.during.report.

Thanks,
Matt.



Vincent Massol made changes - 16/Jul/04 02:49 PM
Field Original Value New Value
Fix Version/s 1.6 [ 10980 ]
Vincent Massol added a comment - 09/Feb/05 03:01 PM

Hi Matt,

Yes, the tests are executed twice but not in the same condition. One time it is without clovering on (i.e. the source code is not instrumented) and the second time clovering is on, the code is instrumented and the tests are generating clover data which are then used by the clover report to produce some HTML file.

I'm probably missing something though...


Vincent Massol made changes - 09/Feb/05 03:02 PM
Fix Version/s 1.7 [ 11256 ]
Affects Version/s 1.5 [ 10377 ]
Affects Version/s 1.6 [ 10980 ]
Assignee Vincent Massol [ vmassol ]
Matt Read added a comment - 10/Feb/05 07:24 AM

It's been some time since I posted this but from memory I thought that once the clover report was registered, all compilations had the effect of instrumenting the code. Are suggesting that code actually gets completely recompiled on the second (clover) run of the tests?

If this is true then with just a fairly comprehensive test suite on a medium sized application, my build is simply doing too much stuff. On a larger application it becomes impractical to use Maven to get my build metrics using continuous integration.

On an XP/Agile project I regularly allocate time to refactor/optimise my test suite in order to decrease the execution time and therefore encourage regular runs of the tests. The impact of running the suite multiple times can be huge.


Vincent Massol added a comment - 10/Feb/05 07:37 AM

General considerations:

I've always found this to be an issue with Maven reports: they not only create a report but they do also perform the logic to create the report data. Thus if you build your project and then generate the site you'll have run twice the build logic that creates the report data.

For your problem:

The only solution I can think of is to have an execute.during.report flag (as you mentioned) so that instrumentation would only happen if this flag is set. If not, the report will take whatever data has already been generated in the Clover database file (which could amount to nothing).

Now in term of sharing the compilation with the junit report, it will be possible by doing the following:

  • set maven.clover.execute.during.report = false
  • call 'maven clover:on site' instead of 'maven site'

Would that be ok with you?


Matt Read added a comment - 10/Feb/05 08:55 AM

Yep, that would solve my immediate (well, immediate 7 months ago) problems.

I agree with you completely on your general consideration point. For the kind of projects that I'm generally involved with, Maven simply will not scale sufficiently to support continuous integration. I find myself slipping back to nightly builds for more and more of the goals as the codebase grows.


Vincent Massol added a comment - 11/Feb/05 10:52 AM

Done. Added new maven.clover.execute.during.report (defaults to true).


Vincent Massol made changes - 11/Feb/05 10:52 AM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]
Fix Version/s 1.7 [ 11256 ]