From 422bafd6ea4a42d818e564a1778407dcc522aaed Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Tue, 9 Feb 2021 12:05:11 +0100 Subject: [PATCH] Exit on all errors in bash scripts when possible Except for the collect-test-info script, the other bash scripts should just exit on error. Change-Id: Ia68bef56edd7edec14f678155220b6e4e15e57f6 --- scripts/collect-test-info.sh | 3 +-- scripts/env-setup.sh | 3 ++- scripts/install-deps.sh | 2 +- scripts/test-bifrost.sh | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/collect-test-info.sh b/scripts/collect-test-info.sh index 6e9e07ae8..c5b047fc7 100755 --- a/scripts/collect-test-info.sh +++ b/scripts/collect-test-info.sh @@ -2,8 +2,7 @@ # Note(TheJulia): We should proceed with attempting to collect information # even if a command fails, and as such set -e should not be present. -set -ux -set -o pipefail +set -uxo pipefail # Note(TheJulia): If there is a workspace variable, we want to utilize that as # the preference of where to put logs diff --git a/scripts/env-setup.sh b/scripts/env-setup.sh index c44929677..fd93e46dc 100755 --- a/scripts/env-setup.sh +++ b/scripts/env-setup.sh @@ -1,5 +1,6 @@ #!/bin/bash -set -eu + +set -euxo pipefail . $(dirname $0)/install-deps.sh # NOTE(pas-ha) the above exports some useful variables like diff --git a/scripts/install-deps.sh b/scripts/install-deps.sh index 7b0b06c1a..d1ab5a4a7 100755 --- a/scripts/install-deps.sh +++ b/scripts/install-deps.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -eu +set -euxo pipefail if [[ "${BIFROST_TRACE:-}" == true ]]; then set -x diff --git a/scripts/test-bifrost.sh b/scripts/test-bifrost.sh index ee9d7f057..0656fb938 100755 --- a/scripts/test-bifrost.sh +++ b/scripts/test-bifrost.sh @@ -1,7 +1,7 @@ #!/bin/bash -set -eux -set -o pipefail +set -euxo pipefail + export PYTHONUNBUFFERED=1 SCRIPT_HOME="$(cd "$(dirname "$0")" && pwd)" BIFROST_HOME=$SCRIPT_HOME/..