Make build fail on test failure
This commit is contained in:
4
Jenkinsfile
vendored
4
Jenkinsfile
vendored
@@ -14,6 +14,10 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
sh "$ANT_HOME/bin/ant test"
|
sh "$ANT_HOME/bin/ant test"
|
||||||
junit 'reports/*.xml'
|
junit 'reports/*.xml'
|
||||||
|
script{
|
||||||
|
if (currentBuild.result == 'UNSTABLE')
|
||||||
|
currentBuild.result = 'FAILURE'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Package'){
|
stage('Package'){
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<target name="test" depends="compile_tests">
|
<target name="test" depends="compile_tests">
|
||||||
<junit printsummary="yes" showoutput="true" haltonfailure="no" fork="yes">
|
<junit printsummary="yes" showoutput="true" haltonfailure="yes" fork="yes">
|
||||||
<classpath>
|
<classpath>
|
||||||
<pathelement location="${build.dir}" /> <!-- compiled production classes -->
|
<pathelement location="${build.dir}" /> <!-- compiled production classes -->
|
||||||
<pathelement location="${test.dir}" /> <!-- compiled test classes -->
|
<pathelement location="${test.dir}" /> <!-- compiled test classes -->
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ public class MainTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test() {
|
public void test() {
|
||||||
assertTrue(true);
|
assertTrue(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user