Skip to content

Commit bb5580b

Browse files
committed
Update bash E2E test undefined variables check
Signed-off-by: Jonathan West <[email protected]>
1 parent ffcb80b commit bb5580b

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

hack/run-rollouts-manager-e2e-tests.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,9 @@ function cleanup {
1313

1414
trap cleanup EXIT
1515

16-
17-
# Treat undefined variables as errors
18-
set -u
19-
2016
extract_metrics_data() {
2117

22-
set +eu
18+
set +e
2319

2420
TMP_DIR=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
2521

@@ -99,7 +95,6 @@ extract_metrics_data() {
9995

10096
}
10197

102-
10398
cd "$SCRIPTPATH/.."
10499

105100
set -o pipefail
@@ -119,16 +114,19 @@ if [[ "$DISABLE_METRICS" == "" ]]; then
119114

120115
fi
121116

122-
set -eu
117+
set -e
123118

124119
if [[ "$DISABLE_METRICS" == "" ]]; then
125120

121+
set -u
122+
126123
INITIAL_GET_REQUESTS=$GET_REQUESTS
127124
INITIAL_PUT_REQUESTS=$PUT_REQUESTS
128125
INITIAL_POST_REQUESTS=$POST_REQUESTS
129126
INITIAL_ERROR_RECONCILES=$ERROR_RECONCILES
130127
INITIAL_SUCCESS_RECONCILES=$SUCCESS_RECONCILES
131128

129+
set +u
132130
fi
133131

134132

@@ -200,6 +198,8 @@ sanity_test_metrics_data() {
200198
exit 1
201199

202200
fi
201+
202+
set +u
203203
}
204204

205205
if [[ "$DISABLE_METRICS" == "" ]]; then
@@ -219,8 +219,6 @@ if [ -f "/tmp/e2e-operator-run.log" ]; then
219219
# Grep the log for unexpected errors
220220
# - Ignore errors that are expected to occur
221221

222-
set +u # allow undefined vars
223-
224222
UNEXPECTED_ERRORS_FOUND_TEXT=`cat /tmp/e2e-operator-run.log | grep "ERROR" | grep -v "because it is being terminated" | grep -v "the object has been modified; please apply your changes to the latest version and try again" | grep -v "unable to fetch" | grep -v "StorageError" | grep -v "client rate limiter Wait returned an error: context canceled" | grep -v "failed to reconcile Rollout's ClusterRoleBinding" | grep -v "clusterrolebindings.rbac.authorization.k8s.io \"argo-rollouts\" already exists"`
225223

226224
if [ "$UNEXPECTED_ERRORS_FOUND_TEXT" != "" ]; then

0 commit comments

Comments
 (0)