diff mbox series

[kvm-unit-tests,PULL,9/9] travis.yml: Prevent 'script' from premature exit

Message ID 20200204071335.18180-10-thuth@redhat.com (mailing list archive)
State New, archived
Headers show
Series [kvm-unit-tests,PULL,1/9] s390x: smp: Cleanup smp.c | expand

Commit Message

Thomas Huth Feb. 4, 2020, 7:13 a.m. UTC
From: Wainer dos Santos Moschetta <wainersm@redhat.com>

The 'script' section finishes its execution prematurely whenever
a shell's exit is called. If the intention is to force
Travis to flag a build/test failure then the correct approach
is erroring any command statement. In this change, it combines
the grep's in a single AND statement that in case of false
Travis will interpret as a build error.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Message-Id: <20200115144610.41655-1-wainersm@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .travis.yml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/.travis.yml b/.travis.yml
index 091d071..f0cfc82 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -119,5 +119,4 @@  before_script:
 script:
   - make -j3
   - ACCEL="${ACCEL:-tcg}" ./run_tests.sh -v $TESTS | tee results.txt
-  - if grep -q FAIL results.txt ; then exit 1 ; fi
-  - if ! grep -q PASS results.txt ; then exit 1 ; fi
+  - grep -q PASS results.txt && ! grep -q FAIL results.txt