Repository: zookeeper
Updated Branches:
  refs/heads/branch-3.4 4b9fe5ea7 -> 053a9d299


ZOOKEEPER-2682: Make it optional to fail build on test failure

Author: Mohammad Arshad <[email protected]>

Reviewers: Rakesh Radhakrishnan <[email protected]>

Closes #164 from arshadmohammad/ZOOKEEPER-2682-branch-3.4


Project: http://git-wip-us.apache.org/repos/asf/zookeeper/repo
Commit: http://git-wip-us.apache.org/repos/asf/zookeeper/commit/053a9d29
Tree: http://git-wip-us.apache.org/repos/asf/zookeeper/tree/053a9d29
Diff: http://git-wip-us.apache.org/repos/asf/zookeeper/diff/053a9d29

Branch: refs/heads/branch-3.4
Commit: 053a9d29973a22ca60a02614911fc6e164d52244
Parents: 4b9fe5e
Author: Mohammad Arshad <[email protected]>
Authored: Tue Feb 7 13:41:54 2017 +0530
Committer: Rakesh Radhakrishnan <[email protected]>
Committed: Tue Feb 7 13:41:54 2017 +0530

----------------------------------------------------------------------
 build.xml | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zookeeper/blob/053a9d29/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index 864c5a4..9c13474 100644
--- a/build.xml
+++ b/build.xml
@@ -84,6 +84,7 @@ xmlns:maven="antlib:org.apache.maven.artifact.ant">
     <property name="test.junit.fork.mode" value="perTest" />
     <property name="test.junit.printsummary" value="yes" />
     <property name="test.junit.haltonfailure" value="no" />
+    <property name="test.junit.failbuild.ontestfailure" value="true" />
     <property name="config.dir" value="${src.dir}/java/test/config" />
     <property name="test.junit.maxmem" value="512m" />
     <property name="test.quick" value="no" />
@@ -1324,6 +1325,9 @@ xmlns:maven="antlib:org.apache.maven.artifact.ant">
             <fileset dir="${test.src.dir}" includes="**/${testcase}.java"/>
           </batchtest>
         </junit>
+        <antcall target="fail.build.on.test.failure"/>
+    </target>
+    <target name="fail.build.on.test.failure" 
if="${test.junit.failbuild.ontestfailure}" >
         <fail if="tests.failed">Tests failed!</fail>
     </target>
 
@@ -1567,7 +1571,7 @@ xmlns:maven="antlib:org.apache.maven.artifact.ant">
                 <fileset dir="${test.src.dir}" includes="**/${testcase}.java"/>
             </batchtest>
         </junit>
-        <fail if="tests.failed">Tests failed!</fail>
+        <antcall target="fail.build.on.test.failure"/>
     </target>
 
     <target name="cobertura-report" depends="cobertura-test">

Reply via email to