[ 
https://issues.apache.org/jira/browse/LUCENE-5439?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Muir updated LUCENE-5439:
--------------------------------
    Attachment: LUCENE-5439.patch

Here is an initial patch that adds 'ant jacoco' (its per-module).

The logic is fairly contained and not nearly as invasive on the build as 
clover. The jacoco task just downloads the jacoco ant tasks from ivy and sets 
up JVM parameters to junit4 slaves so that each slave writes its own coverage 
database. When producing reports we just merge coverage databases across all 
the slaves.

Today the clover build takes many hours and this is a nice alternative. For 
example 'ant jacoco' on lucene-core is quite fast (on my machine, about as fast 
as running tests normally).

{noformat}
  ...
   [junit4] JVM J0:     1.24 ..   146.46 =   145.22s
   [junit4] JVM J1:     1.46 ..   146.30 =   144.85s
   [junit4] JVM J2:     1.71 ..   146.37 =   144.65s
   [junit4] JVM J3:     1.46 ..   146.49 =   145.03s
   [junit4] Execution time total: 2 minutes 26 seconds
   [junit4] Tests summary: 414 suites, 3438 tests, 154 ignored (144 assumptions)
     [echo] 5 slowest tests:
[junit4:tophints]  14.63s | org.apache.lucene.index.TestDocValuesFormat
[junit4:tophints]  14.31s | org.apache.lucene.index.TestNormsFormat
[junit4:tophints]  11.80s | org.apache.lucene.index.TestTermVectorsFormat
[junit4:tophints]  11.76s | 
org.apache.lucene.codecs.compressing.TestCompressingTermVectorsFormat
[junit4:tophints]  11.16s | 
org.apache.lucene.codecs.lucene50.TestLucene50DocValuesFormat

-check-totals:

-post-jacoco:
   [delete] Deleting directory 
/home/rmuir/workspace/trunk-iw/lucene/build/jacoco/core
    [mkdir] Created dir: /home/rmuir/workspace/trunk-iw/lucene/build/jacoco/core
[jacoco:report] Loading execution data file 
/home/rmuir/workspace/trunk-iw/lucene/build/core/test/J0/jacoco.db
[jacoco:report] Loading execution data file 
/home/rmuir/workspace/trunk-iw/lucene/build/core/test/J1/jacoco.db
[jacoco:report] Loading execution data file 
/home/rmuir/workspace/trunk-iw/lucene/build/core/test/J2/jacoco.db
[jacoco:report] Loading execution data file 
/home/rmuir/workspace/trunk-iw/lucene/build/core/test/J3/jacoco.db
[jacoco:report] Writing bundle 'lucene-core-6.0.0-SNAPSHOT JaCoCo coverage 
report' with 1371 classes

jacoco:

BUILD SUCCESSFUL
Total time: 2 minutes 30 seconds
{noformat}

You can see this coverage report for lucene-core (only from lucene-core's 
tests) here:
http://people.apache.org/~rmuir/jacoco-core/

I will now look at adding some top-level build tasks that merge coverage dbs 
across all modules for an aggregate view similar to what clover does, too. But 
i really like having the per-module option at least for now.


> Add Jacoco option for Test Coverage
> -----------------------------------
>
>                 Key: LUCENE-5439
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5439
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Robert Muir
>            Priority: Minor
>         Attachments: LUCENE-5439.patch
>
>
> Jacoco (http://www.jacoco.org/) is a much cleaner and simpler to use code 
> coverage tool than clover and additionally doesn't require having a third 
> party license since it is open source.  It also has nice Jenkins integration 
> tools that make it incredibly easy to see what is and isn't tested.  We 
> should convert the Lucene and Solr builds to use Jacoco instead of Clover.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to