Make build fail on test failure

This commit is contained in:
Flare Microsystems
2024-11-08 19:36:26 -08:00
parent 1ffd4fdbe6
commit 98c00fc1c0
3 changed files with 6 additions and 2 deletions

4
Jenkinsfile vendored
View File

@@ -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'){

View File

@@ -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 -->

View File

@@ -8,7 +8,7 @@ public class MainTest {
@Test @Test
public void test() { public void test() {
assertTrue(true); assertTrue(false);
} }
} }