From 7ff6e8a1dcc1a9dc47670dc17c2f107f2a84256e Mon Sep 17 00:00:00 2001 From: Rob Wu Date: Wed, 20 Jun 2018 00:35:04 +0200 Subject: [PATCH] chore: Stop swallowing errors in .sh tests The Bash shell scripts ignored errors in all but the last line. This commit adds `set -eo pipefail` to fix the issue: `set -e` causes the script to exit as soon as any command exits with a non-zero exit code. When pipes are used, this flag only applies to the last command in a pipe. The `set -o pipefail` option ensures that the script is also exited with a non-zero exit code when any command in the pipe fails. --- test/run-browsers-smoketests.sh | 2 ++ test/run-module-bundlers-smoketests.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/test/run-browsers-smoketests.sh b/test/run-browsers-smoketests.sh index 1b39c4c..8e3e738 100755 --- a/test/run-browsers-smoketests.sh +++ b/test/run-browsers-smoketests.sh @@ -1,4 +1,6 @@ #!/bin/bash +set -eo pipefail + echo "" echo "Test webextension-polyfill on real browsers" echo "===========================================" diff --git a/test/run-module-bundlers-smoketests.sh b/test/run-module-bundlers-smoketests.sh index 62a06e3..0a0c6d0 100755 --- a/test/run-module-bundlers-smoketests.sh +++ b/test/run-module-bundlers-smoketests.sh @@ -1,4 +1,6 @@ #!/bin/bash +set -eo pipefail + echo "" echo "Test webextension-polyfill bundled with webpack" echo "==============================================="