kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wainer dos Santos Moschetta <wainersm@redhat.com>
To: Thomas Huth <thuth@redhat.com>, kvm@vger.kernel.org
Cc: pbonzini@redhat.com
Subject: Re: [kvm-unit-tests] travis.yml: Prevent 'script' section from premature exit
Date: Tue, 14 Jan 2020 15:47:17 -0200	[thread overview]
Message-ID: <0b4a3ecd-e12e-67bd-c1ac-2543b2aebc45@redhat.com> (raw)
In-Reply-To: <59bd7e8c-8321-8868-27a9-fb8a968e1ce0@redhat.com>


On 1/14/20 2:48 PM, Thomas Huth wrote:
> On 13/01/2020 20.51, 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 build command. In this change, it executes a
>> sub-shell process and exit 1, so that Travis capture the return
>> code and interpret it as a build error.
>>
>> Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
>> ---
>>   .travis.yml | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/.travis.yml b/.travis.yml
>> index 091d071..a4405c3 100644
>> --- a/.travis.yml
>> +++ b/.travis.yml
>> @@ -119,5 +119,5 @@ 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
>> +  - if grep -q FAIL results.txt ; then $(exit 1) ; fi
>> +  - if ! grep -q PASS results.txt ; then $(exit 1) ; fi
> Basically a good idea, but I think we can even simplify these two lines
> into:
>
>   grep -q PASS results.txt && ! grep -q FAIL results.txt

Indeed this is a better idea.

>
> If you agree, could you update your patch and send a v2?

Sure, I will send the v2 with your proposed changes. Thanks!

- Wainer

>
>   Thanks,
>    Thomas


      reply	other threads:[~2020-01-14 17:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-13 19:51 [kvm-unit-tests] travis.yml: Prevent 'script' section from premature exit Wainer dos Santos Moschetta
2020-01-14 16:48 ` Thomas Huth
2020-01-14 17:47   ` Wainer dos Santos Moschetta [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0b4a3ecd-e12e-67bd-c1ac-2543b2aebc45@redhat.com \
    --to=wainersm@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).