Skip to content

Commit ffcb80b

Browse files
committed
Allow disabling of E2E test metrics gathering
Signed-off-by: Jonathan West <[email protected]>
1 parent 38faac6 commit ffcb80b

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

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

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,24 @@ if [ $retVal -ne 0 ]; then
112112
kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/release-0.52/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml
113113
fi
114114

115-
# Before the test starts, extract initial metrics values from the /metrics endpoint of the operator
116-
extract_metrics_data
115+
if [[ "$DISABLE_METRICS" == "" ]]; then
116+
117+
# Before the test starts, extract initial metrics values from the /metrics endpoint of the operator
118+
extract_metrics_data
119+
120+
fi
117121

118122
set -eu
119123

120-
INITIAL_GET_REQUESTS=$GET_REQUESTS
121-
INITIAL_PUT_REQUESTS=$PUT_REQUESTS
122-
INITIAL_POST_REQUESTS=$POST_REQUESTS
123-
INITIAL_ERROR_RECONCILES=$ERROR_RECONCILES
124-
INITIAL_SUCCESS_RECONCILES=$SUCCESS_RECONCILES
124+
if [[ "$DISABLE_METRICS" == "" ]]; then
125+
126+
INITIAL_GET_REQUESTS=$GET_REQUESTS
127+
INITIAL_PUT_REQUESTS=$PUT_REQUESTS
128+
INITIAL_POST_REQUESTS=$POST_REQUESTS
129+
INITIAL_ERROR_RECONCILES=$ERROR_RECONCILES
130+
INITIAL_SUCCESS_RECONCILES=$SUCCESS_RECONCILES
131+
132+
fi
125133

126134

127135
# Run the tests
@@ -194,7 +202,9 @@ sanity_test_metrics_data() {
194202
fi
195203
}
196204

197-
sanity_test_metrics_data
205+
if [[ "$DISABLE_METRICS" == "" ]]; then
206+
sanity_test_metrics_data
207+
fi
198208

199209
set +e
200210

@@ -222,6 +232,4 @@ if [ -f "/tmp/e2e-operator-run.log" ]; then
222232
exit 1
223233
fi
224234
fi
225-
226-
227235
fi

0 commit comments

Comments
 (0)