You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Dawid Weiss (Jira)" <ji...@apache.org> on 2020/02/10 12:18:00 UTC

[jira] [Comment Edited] (LUCENE-9188) Add jacoco code coverage support to gradle build

    [ https://issues.apache.org/jira/browse/LUCENE-9188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17033549#comment-17033549 ] 

Dawid Weiss edited comment on LUCENE-9188 at 2/10/20 12:17 PM:
---------------------------------------------------------------

I'm not really familiar with jacoco - I can imagine test coverage reports can be useful but I don't run them myself. In fact, I ignored jacoco when porting ant code because I didn't think anybody was looking into those reports? 

Anyway. The patch looks good overall. Minor comments.

{code}
+      // XXX: too many things called "workingDir" in gradle!
+      def targetDir = "${buildDir}/tmp/tests-cwd"
{code}
There is an extension property set on each project in defaults-tests.gradle:
{code}
    project.ext {
      testsCwd = file("${buildDir}/tmp/tests-cwd") 
{code}
so you could replace targetDir with pahs referencing that instead.

{code}
+      systemProperty 'junit4.childvm.cwd', workingDir as String
{code}

I don't think we have to pass this property anymore. This was used by randomizedtesting ant runner to pass cwd for different forked JVMs (because it wasn't known apriori in isolation mode). The property is referenced from security policies but it could just become a reference to ${user.dir}.





was (Author: dweiss):
I'm not really familiar with jacoco - I can imagine test coverage reports can be useful but I don't run them myself. In fact, I ignored jacoco when porting ant code because I didn't think anybody was looking into those reports? 

Anyway. The patch looks good overall. Minor comments.

{code}
+      // XXX: too many things called "workingDir" in gradle!
+      def targetDir = "${buildDir}/tmp/tests-cwd"
{code}
There is an extension property set on each project in defaults-tests.gradle:
{code}
    project.ext {
      testsCwd = file("${buildDir}/tmp/tests-cwd") 
{code}
so you could replace targetDir with papths referencing that instead.

{code}
+      systemProperty 'junit4.childvm.cwd', workingDir as String
{code}

I don't think we have to pass this property anymore. This was used by randomizedtesting ant runner to pass cwd for different forked JVMs (because it wasn't known apriori in isolation mode). The property is referenced from security policies but it could just become a reference to ${user.dir}.




> Add jacoco code coverage support to gradle build
> ------------------------------------------------
>
>                 Key: LUCENE-9188
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9188
>             Project: Lucene - Core
>          Issue Type: Task
>          Components: general/build
>            Reporter: Robert Muir
>            Priority: Major
>         Attachments: LUCENE-9188.patch, report.png
>
>
> Seems to be missing. I looked into it a little, all the documented ways of using the jacoco plugin seem to involve black magic if you are using "java" plugin, but we are using "javaLibrary", so I wasn't able to hold it right.
> This one should work very well, it has low overhead and should work fine running tests in parallel (since it supports merging of coverage data files: that's how it works in the ant build)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org