All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] travis.yml: Prevent 'script' from premature exit
@ 2020-01-15 13:17 Wainer dos Santos Moschetta
  2020-01-15 13:38 ` Thomas Huth
  0 siblings, 1 reply; 2+ messages in thread
From: Wainer dos Santos Moschetta @ 2020-01-15 13:17 UTC (permalink / raw)
  To: kvm; +Cc: pbonzini, thuth

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>
---
 Changes v1 to v2:
   - Simplify the grep's in a single statement [thuth]
   - Also grep for SKIP (besides PASS) [myself]
 .travis.yml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 091d071..0a92bc5 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\|SKIP' results.txt && ! grep -q FAIL results.txt
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] travis.yml: Prevent 'script' from premature exit
  2020-01-15 13:17 [PATCH v2] travis.yml: Prevent 'script' from premature exit Wainer dos Santos Moschetta
@ 2020-01-15 13:38 ` Thomas Huth
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Huth @ 2020-01-15 13:38 UTC (permalink / raw)
  To: Wainer dos Santos Moschetta, kvm; +Cc: pbonzini

On 15/01/2020 14.17, Wainer dos Santos Moschetta wrote:
> 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>
> ---
>  Changes v1 to v2:
>    - Simplify the grep's in a single statement [thuth]
>    - Also grep for SKIP (besides PASS) [myself]
>  .travis.yml | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/.travis.yml b/.travis.yml
> index 091d071..0a92bc5 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\|SKIP' results.txt && ! grep -q FAIL results.txt

I think we want to see at least one "PASS" in the output, otherwise it's
an indication that something went wrong in the CI - I've seen bugs in
the past that caused all tests to SKIP, and we should fail the CI in
that case, too. So I'd suggest to remove the "SKIP" from the grep
statement again.

 Thomas


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-15 13:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-15 13:17 [PATCH v2] travis.yml: Prevent 'script' from premature exit Wainer dos Santos Moschetta
2020-01-15 13:38 ` Thomas Huth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.