From 98c00fc1c02a36da937b389e215666f96d63d8e4 Mon Sep 17 00:00:00 2001 From: Flare Microsystems Date: Fri, 8 Nov 2024 19:36:26 -0800 Subject: [PATCH] Make build fail on test failure --- Jenkinsfile | 4 ++++ build.xml | 2 +- test/com/flaremicro/crossjeeves/MainTest.java | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 80315b8..aa0aef4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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'){ diff --git a/build.xml b/build.xml index 035b5fa..be865b9 100644 --- a/build.xml +++ b/build.xml @@ -44,7 +44,7 @@ - + diff --git a/test/com/flaremicro/crossjeeves/MainTest.java b/test/com/flaremicro/crossjeeves/MainTest.java index db73d01..e491fe0 100644 --- a/test/com/flaremicro/crossjeeves/MainTest.java +++ b/test/com/flaremicro/crossjeeves/MainTest.java @@ -8,7 +8,7 @@ public class MainTest { @Test public void test() { - assertTrue(true); + assertTrue(false); } }