[
https://issues.apache.org/jira/browse/ZOOKEEPER-2266?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Akihiro Suda updated ZOOKEEPER-2266:
------------------------------------
Attachment: ZOOKEEPER-2266-v4.patch
Hello [~phunt],
Thank you for the comment.
Attached v4.patch:
* Set {{jacoco.enabled}} to {{false}] by default
* JaCoCo jars are pulled only when {{jacoco.enabled}} is {{true}}
* Use fileset for JaCoCo jars in {{build.xml}}
* Eliminated tabs
How to check {{jacoco.enabled}} is implemented as follows:
{code:xml}
<target name="junit.run-concurrent"
if="ant.supports.concurrent.junit.processes"
depends="junit.run-concurrent.nojacoco,junit.run-concurrent.jacoco" />
<target name="junit.run-concurrent.nojacoco" unless="${jacoco.enabled}">
..
</target>
<target name="junit.run-concurrent.jacoco" if="${jacoco.enabled}"
depends="jacoco-init">
..
</target>
{code}
Unfortunately there is a {{<junit>}} code clone between
{{junit.run-concurrent.nojacoco}} and {{junit.run-concurrent.jacoco}}, but I
could not find a way to deduplicate this.
If I split the {{<junit>}} as an independent task, and put {{<antcall
target="that-junit-task">}} in {{<jacoco:coverage>}}, I get an error {{antcall
is not a valid child of the coverage task}}.
{{<macrodef>}} also throws a similar error as well.
> Integrate JaCoCo Coverage Library
> ---------------------------------
>
> Key: ZOOKEEPER-2266
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2266
> Project: ZooKeeper
> Issue Type: Improvement
> Components: tests
> Reporter: Akihiro Suda
> Assignee: Akihiro Suda
> Priority: Minor
> Attachments: ZOOKEEPER-2266-v1.patch, ZOOKEEPER-2266-v2.patch,
> ZOOKEEPER-2266-v3.patch, ZOOKEEPER-2266-v4.patch, jacoco-report-example.zip
>
>
> I would like to propose integration of
> [JaCoCo|http://www.eclemma.org/jacoco/] coverage library with ZooKeeper.
> h4. Purposes
> - To find poorly covered methods, and improve JUnit testcases to cover them
> - To estimate causes of flaky testcases (e.g. ZOOKEEPER-2080,
> ZOOKEEPER-2252, ZOOKEEPER-1868) by comparing reports from succeeded
> experiments and failed ones (I'm recently interested in how we can
> systematically realize this.)
> h4. Advantages of JaCoCo
> - Support recent JDKs (including JDK 8)
> - Low overhead
> - Released under EPL
> -- Note: cobertura has been removed from the code base because it is
> released under GPL ( ZOOKEEPER-75,
> http://www.apache.org/legal/resolved.html#category-x )
> h4. Usage
> {panel}
> $ ant test #(plus optionally, -Dtestcase=.. -Dtest.method=..)
> $ ant jacoco-report
> $ x-www-browser build/test/jacoco/reports/index.html &
> {panel}
> Example: jacoco-report-example.zip
> h4. Possible Future Work
> - Integrate to Jenkins buildbot so that we can check coverage after each of
> builds
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)