Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9FBE8200CFE for ; Fri, 8 Sep 2017 15:21:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9E4671609A7; Fri, 8 Sep 2017 13:21:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BC8241609BD for ; Fri, 8 Sep 2017 15:21:09 +0200 (CEST) Received: (qmail 55538 invoked by uid 500); 8 Sep 2017 13:21:08 -0000 Mailing-List: contact dev-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list dev@groovy.apache.org Received: (qmail 55432 invoked by uid 99); 8 Sep 2017 13:21:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Sep 2017 13:21:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 2FE80C7B5A for ; Fri, 8 Sep 2017 13:21:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.379 X-Spam-Level: ** X-Spam-Status: No, score=2.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id JZ2r3DrafzZ7 for ; Fri, 8 Sep 2017 13:21:06 +0000 (UTC) Received: from mail-lf0-f42.google.com (mail-lf0-f42.google.com [209.85.215.42]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 9AF445F5B3 for ; Fri, 8 Sep 2017 13:21:05 +0000 (UTC) Received: by mail-lf0-f42.google.com with SMTP id m199so5635523lfe.3 for ; Fri, 08 Sep 2017 06:21:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=fL7S9eWbHNLeDcHLNShm6+0A5QVZlnygo6Dh6uuUfTs=; b=OlmnexaHn0ACrYMWJV/7BCTWtQWWP7/oRqrKRh1I2KUFnDl1bxv822o2SzvznisZIb NTp09cGOQKuDk/9Hi+2pCLA69EpVpsDEH/5/Hbse3rsndS242OA7jU3DHVMZjph5NCpt K22ZDePzpSAnX81OYJw3U+kzLpopMj02Roa6wv/1V0Jv24sO/d8kCStyKa0vmzVe1Pzi 32zlywRXxmX7bJnsiygcTqIe4s+OaGwOvqhOS7A8lo37KD9z1MnoIkEFUkNFnpMxFmeo u2NYNd7xh0N9v0nbTeyNq4tUGs3UcmsA7XPlFRfnXlS09cJauOOUAnsx1QxwLsEMtRfM 1uKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=fL7S9eWbHNLeDcHLNShm6+0A5QVZlnygo6Dh6uuUfTs=; b=Ll44U0GPSWx2cGLflw20l6xvECu7LGwCbLF1katTy3dQiuOZ/TpLtd38CrWoAExQ81 U3VcfxpJQqX+/sLWlyampRGBNyg/M2FmbM0fcoh1x9kCrznyuE4xH//9C88OI7W3H7ce MojE2h5nPFicR0+rFrj6W5g9h0bheybEWoDpaPztH4gKAEUaGmiOxTTOPt9hYyLjcBMv zqqqa/BFhwTxcjbn0JjIZVbiM++an8Ud/p1TfBnKMG/4EjnRo4jH/WHg8iThpX6qnSxH FucHBHqa6kQVb4rtVk223azDfRt1V+v8L4J4V4OAtoW4Yb6tS8xgcqARf8N3pNhIQwD8 d+jw== X-Gm-Message-State: AHPjjUj3+NGOAd2ecDbK6aeveXi5PMjl5CDjMkCpw/lVsX5lbzn1dpaR twGnYUt0CaDR0QpBDf11VF+NIQsT7A== X-Google-Smtp-Source: ADKCNb4rK5s8UcpeTr1ERle1LOMlRWW3tZYL1DLNZ+PDbekZhPMLaJsF6ysGYqoGxAcOhms5KA6SBamKyoJPn77ZdmA= X-Received: by 10.46.83.23 with SMTP id h23mr1060873ljb.8.1504876864087; Fri, 08 Sep 2017 06:21:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.170.211 with HTTP; Fri, 8 Sep 2017 06:21:03 -0700 (PDT) In-Reply-To: <327088564.2570687.1504876309163.JavaMail.zimbra@u-pem.fr> References: <1116949062.2563601.1504875627771.JavaMail.zimbra@u-pem.fr> <327088564.2570687.1504876309163.JavaMail.zimbra@u-pem.fr> From: Andres Almiray Date: Fri, 8 Sep 2017 15:21:03 +0200 Message-ID: Subject: Re: Groovy and code coverage To: dev@groovy.apache.org Content-Type: multipart/alternative; boundary="94eb2c1cf1baea29f90558ad72bd" archived-at: Fri, 08 Sep 2017 13:21:10 -0000 --94eb2c1cf1baea29f90558ad72bd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I see. Also, the retention policy JaCoCo expects is CLASS, not SOURCE. ------------------------------------------- Java Champion; Groovy Enthusiast http://andresalmiray.com http://www.linkedin.com/in/aalmiray -- What goes up, must come down. Ask any system administrator. There are 10 types of people in the world: Those who understand binary, and those who don't. To understand recursion, we must first understand recursion. On Fri, Sep 8, 2017 at 3:11 PM, Remi Forax wrote: > > > ------------------------------ > > *De: *"C=C3=A9dric Champeau" > *=C3=80: *"dev" > *Envoy=C3=A9: *Vendredi 8 Septembre 2017 15:03:05 > *Objet: *Re: Groovy and code coverage > > Damn, who thought it was a good idea to put TIMESTAMPS in generated > sources? > > > It's a drop in replacement for javax.annotation.Generated [1] which is in > a module what will be removed [2] from the modules of Java SE, > so a long time ago :) > > R=C3=A9mi > > [1] https://docs.oracle.com/javase/8/docs/api/javax/ > annotation/Generated.html > [2] https://bugs.openjdk.java.net/browse/JDK-8152842 > > > 2017-09-08 15:00 GMT+02:00 Remi Forax : > >> A standard annotation for generated code was added in Java 9: >> http://download.java.net/java/jdk9/docs/api/javax/annotation/processing/ >> Generated.html >> >> R=C3=A9mi >> >> ------------------------------ >> >> *De: *"Andres Almiray" >> *=C3=80: *dev@groovy.apache.org >> *Envoy=C3=A9: *Vendredi 8 Septembre 2017 11:41:18 >> *Objet: *Groovy and code coverage >> >> Hello everyone, >> >> As you may be aware there are only a few choices in the Java pace that >> can be used for code coverage, JaCoCo being the one that gives the most >> accurate results. While it's easy to setup JaCoco for Groovy sources the= re >> are times where the tool reports no coverage for some lines of code that >> should not have been counted for coverage in the first case, these are s= ome >> of the methods coming from GroovyObject and AST transformations, >> specifically `getProperty`, `setProperty`, `getMetaClass`, and >> `invokeMethod`. >> >> I had a chat with Marc Hoffmann yesterday about this situation, which is >> a topic we've discussed a few times in the past. I've got some good news= , >> Groovy is not alone in this problem, the Lombok project has suffered the >> same fate which has prompted them to seek a solution. The alternative th= ey >> came up with is to have Lombok identified generated code that should not= be >> covered with a special annotation (@lombok.Generated), JaCoCo has a >> filtering feature (not yet public) that can identify elements annotated >> with said annotation and skip them from coverage reports. See >> >> https://projectlombok.org/api/index.html?lombok/Generated.html >> https://github.com/jacoco/jacoco/pull/513 >> https://github.com/jacoco/jacoco/blob/master/org.jacoco. >> core/src/org/jacoco/core/internal/analysis/filter/ >> LombokGeneratedFilter.java >> >> This feature will be available for consumption in the next releases of >> Lombok (1.16.8+) and JaCoCo (0.7.9+). >> >> Given this, Marc suggested that Groovy could follow the same idea and >> provide an annotation that JaCoCo can identify, say for example >> @groovy.transform.Generated. >> >> If such annotation were to be added to Groovy we would need (at least) >> the following steps too: >> - update compiler to annotate `getProperty`, `setProperty`, >> `getMetaClass`, and `invokeMethod` when the class does not explicitly >> defines any of those methods. >> - review and update all core AST xforms that generate methods that >> should be skipped from coverage. >> - document the usage of this annotation and encourage AST xform >> developers to use it once they upgrade. >> >> Would be great to have this feature in the 2.6.0 release if possible. >> >> Thoughts? >> >> ------------------------------------------- >> Java Champion; Groovy Enthusiast >> http://andresalmiray.com >> http://www.linkedin.com/in/aalmiray >> -- >> What goes up, must come down. Ask any system administrator. >> There are 10 types of people in the world: Those who understand binary, >> and those who don't. >> To understand recursion, we must first understand recursion. >> >> > --94eb2c1cf1baea29f90558ad72bd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I see. Also, the retention policy JaCoCo expects is CLASS,= not SOURCE.

-------------------------------------------
Java Champion; Gro= ovy Enthusiast
ht= tp://andresalmiray.com
http://www.linkedin.com/in/aalmiray
--
What = goes up, must come down. Ask any system administrator.
There are 10 type= s of people in the world: Those who understand binary, and those who don= 9;t.
To understand recursion, we must first understand recursion.
<= /div>

On Fri, Sep 8, 2017 at 3:11 PM, Remi Forax <= span dir=3D"ltr"><forax@univ-mlv.fr> wrote:
=



De:= "C=C3=A9dric Champeau" <cedric.champeau@gmail.com>
=C3= =80: "dev" <dev@groovy.apache.org>
Envoy=C3=A9: Vendredi = 8 Septembre 2017 15:03:05
Objet: Re: Groovy and = code coverage
Damn, who thought it was a = good idea to put TIMESTAMPS in generated sources?
It's a drop in replacement for javax.annotation.Generated = [1] which is in a module what will be removed [2] from the modules of Java = SE,
so a long time ago :)

R=C3= =A9mi



2017-09-08 15:00 GMT+02:00 Remi Forax <forax@univ-= mlv.fr>:
= A standard annotation for generated code was added in Java 9:
http://download.java.net/java/jdk9/docs/api/javax/annotation/processing/Generated.html

R=C3=A9mi


De: "Andres Almiray" <aalmiray@gmail.com>
=C3=80:= dev@groovy.= apache.org
Envoy=C3=A9: Vendredi 8 Septembre 2017 11:41:18Objet: Groovy and code coverage
Hello everyone,

As you may be aw= are there are only a few choices in the Java pace that can be used for code= coverage, JaCoCo being the one that gives the most accurate results. While= it's easy to setup JaCoco for Groovy sources there are times where the= tool reports no coverage for some lines of code that should not have been = counted for coverage in the first case, these are some of the methods comin= g from GroovyObject and AST transformations, specifically `getProperty`, `s= etProperty`, `getMetaClass`, and `invokeMethod`.

I had a chat with M= arc Hoffmann yesterday about this situation, which is a topic we've dis= cussed a few times in the past. I've got some good news, Groovy is not = alone in this problem, the Lombok project has suffered the same fate which = has prompted them to seek a solution. The alternative they came up with is = to have Lombok identified generated code that should not be covered with a = special annotation (@lombok.Generated), JaCoCo has a filtering feature (not= yet public) that can identify elements annotated with said annotation and = skip them from coverage reports. See

https://proj= ectlombok.org/api/index.html?lombok/Generated.html
https://gi= thub.com/jacoco/jacoco/pull/513
https://github.com= /jacoco/jacoco/blob/master/org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/LombokGeneratedFilter.java

This= feature will be available for consumption in the next releases of Lombok (= 1.16.8+) and JaCoCo (0.7.9+).

Given this, Marc suggested that Groovy= could follow the same idea and provide an annotation that JaCoCo can ident= ify, say for example @groovy.transform.Generated.

If such annotation= were to be added to Groovy we would need (at least) the following steps to= o:
=C2=A0- update compiler to annotate `getProperty`, `setProperty`, `ge= tMetaClass`, and `invokeMethod` when the class does not explicitly defines = any of those methods.
=C2=A0- review and update all core AST xforms that= generate methods that should be skipped from coverage.
=C2=A0- document= the usage of this annotation and encourage AST xform developers to use it = once they upgrade.

Would be great to have this feature in the 2.6.0 = release if possible.

Thoughts?

-------------------------------------------
Java Champion= ; Groovy Enthusiast
http://andresalmiray.com
http://www.linkedin.com/in/aalmiray
-= -
What goes up, must come down. Ask any system administrator.
There a= re 10 types of people in the world: Those who understand binary, and those = who don't.
To understand recursion, we must first understand recursi= on.

<= /div>


--94eb2c1cf1baea29f90558ad72bd--