Fix commit message validation reporting
"set -e" was aborting the script after grep doesn't find the Bug line,
and "set -x" makes things overly verbose. So perform the validation
before these options are set.
Also return 1 instead of 0 on failure.
Bug: b/141892461
Change-Id: Ica0364ff49383b47cf37b3a02d6b03e55d8d88ad
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/37008
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
diff --git a/tests/kokoro/gcp_ubuntu/continuous.sh b/tests/kokoro/gcp_ubuntu/continuous.sh
index 373da9b..2528f3c 100644
--- a/tests/kokoro/gcp_ubuntu/continuous.sh
+++ b/tests/kokoro/gcp_ubuntu/continuous.sh
@@ -1,10 +1,5 @@
#!/bin/bash
-# Fail on any error.
-set -e
-# Display commands being run.
-set -x
-
cd git/SwiftShader
# Validate commit message
@@ -12,10 +7,15 @@
if [ $? -ne 0 ]
then
- echo "Commit message must have a Bug: line."
- exit 0
+ echo "error: Git commit message must have a Bug: line."
+ exit 1
fi
+# Fail on any error.
+set -e
+# Display commands being run.
+set -x
+
# Download all submodules
git submodule update --init