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