Hi

Several of our Jenkins regression tests are controlled by bash scripts.  As a 
beginner bash script writer, I would like some advice on how to improve the 
error handling in those scripts please.

We use the bash shebang:

#!/bin/bash -ex

A typical test might compare some result files with reference files:

    for RESULT_FILE in $RESULT_FILE_LIST
    do
        diff -b --brief $RESULT_FILE $REF_PATH/$RESULT_FILE
    done

The problem here is that the 'for' loop exits on the first 'diff' failure, the 
script then exits and Jenkins fails the test.

I would prefer the 'for' loop to complete so that I get a list of all failing 
files, before Jenkins terminates the test.

What would be a neat way of achieving this in bash?

Best regards

David

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to