Repository: cassandra
Updated Branches:
  refs/heads/trunk e7d9678be -> 815f77c48


Backport test parallelization build tasks

patch by rhatch; reviewed by aweisberg for CASSANDRA-10703


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/3851670d
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/3851670d
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/3851670d

Branch: refs/heads/trunk
Commit: 3851670d7871e1afc519fa30d66f6155b87be4de
Parents: bdd88a2
Author: Sylvain Lebresne <sylv...@datastax.com>
Authored: Fri Nov 20 13:13:54 2015 +0100
Committer: Sylvain Lebresne <sylv...@datastax.com>
Committed: Fri Nov 20 13:13:54 2015 +0100

----------------------------------------------------------------------
 build.xml | 34 ++++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/3851670d/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index d479a70..81ab58f 100644
--- a/build.xml
+++ b/build.xml
@@ -56,6 +56,7 @@
     <property name="test.conf" value="${test.dir}/conf"/>
     <property name="test.data" value="${test.dir}/data"/>
     <property name="test.name" value="*Test"/>
+    <property name="test.classlistfile" value="testlist.txt"/>
     <property name="benchmark.name" value=""/>
     <property name="test.methods" value=""/>
     <property name="test.runners" value="1"/>
@@ -110,8 +111,10 @@
     
     <!-- http://www.eclemma.org/jacoco/ -->
     <property name="jacoco.export.dir" value="${build.dir}/jacoco/" />
-    <property name="jacoco.execfile" value="${jacoco.export.dir}/jacoco.exec" 
/>
-    <property name="jacoco.version" value="0.7.1.201405082137"/>
+    <property name="jacoco.partials.dir" value="${jacoco.export.dir}/partials" 
/>
+    <property name="jacoco.partialexecfile" 
value="${jacoco.partials.dir}/partial.exec" />
+    <property name="jacoco.finalexecfile" 
value="${jacoco.export.dir}/jacoco.exec" />
+    <property name="jacoco.version" value="0.7.5.201505241946"/>
 
     <property name="ecj.version" value="4.4.2"/>
 
@@ -180,6 +183,7 @@
         <mkdir dir="${build.src.gen-java}"/>
         <mkdir dir="${build.dir.lib}"/>
         <mkdir dir="${jacoco.export.dir}"/>
+        <mkdir dir="${jacoco.partials.dir}"/>
     </target>
 
     <target name="clean" description="Remove all locally created artifacts">
@@ -189,6 +193,7 @@
         <delete dir="${build.src.gen-java}" />
         <delete dir="${version.properties.dir}" />
         <delete dir="${jacoco.export.dir}" />
+        <delete dir="${jacoco.partials.dir}"/>
     </target>
     <target depends="clean" name="cleanall"/>
 
@@ -1176,7 +1181,7 @@
     <attribute name="usejacoco" default="no"/>
     <sequential>
       <condition property="additionalagent"
-                 
value="-javaagent:${build.dir.lib}/jars/jacocoagent.jar=destfile=${jacoco.execfile}"
+                 
value="-javaagent:${build.dir.lib}/jars/jacocoagent.jar=destfile=${jacoco.partialexecfile}"
                  else="">
         <istrue value="${usejacoco}"/>
       </condition>
@@ -1490,10 +1495,16 @@
     <typedef uri="antlib:org.jacoco.ant" classpathref="jacocoant.classpath"/>
   </target>
 
-  <target name="jacoco-report" depends="jacoco-init">
+  <target name="jacoco-merge" depends="jacoco-init">
+    <jacoco:merge destfile="${jacoco.finalexecfile}" 
xmlns:jacoco="antlib:org.jacoco.ant">
+        <fileset dir="${jacoco.export.dir}" includes="*.exec,**/*.exec"/>
+    </jacoco:merge>
+  </target>
+
+  <target name="jacoco-report" depends="jacoco-merge">
     <jacoco:report xmlns:jacoco="antlib:org.jacoco.ant">
       <executiondata>
-        <file file="${jacoco.execfile}" />
+        <file file="${jacoco.finalexecfile}" />
       </executiondata>
       <structure name="JaCoCo Cassandara Coverage Report">
         <classfiles>
@@ -1516,7 +1527,7 @@
   </target>
 
   <target name="jacoco-cleanup" description="Destroy JaCoCo exec data and 
reports">
-    <delete file="${jacoco.execfile}"/>
+    <delete file="${jacoco.partialexecfile}"/>
     <delete dir="${jacoco.export.dir}"/>
   </target>
 
@@ -1705,6 +1716,17 @@
     <testparallel testdelegate="testlist"/>
   </target>
 
+  <!-- run a list of tests as provided in -Dtest.classlistfile (or default of 
'testnames.txt')
+  The class list file should be one test class per line, with the path 
starting after test/unit
+  e.g. org/apache/cassandra/hints/HintMessageTest.java -->
+  <target name="testclasslist" depends="build-test" description="Parallel-run 
tests given in file -Dtest.classlistfile (one-class-per-line, e.g. 
org/apache/cassandra/db/SomeTest.java)">
+    <path id="all-test-classes-path">
+      <fileset dir="${test.unit.src}" includesfile="${test.classlistfile}"/>
+    </path>
+    <property name="all-test-classes" refid="all-test-classes-path"/>
+    <testparallel testdelegate="testlist"/>
+  </target>
+
   <!-- run microbenchmarks suite -->
   <target name="microbench" depends="build-test">
       <java classname="org.openjdk.jmh.Main"

Reply via email to