Skip to content

Commit 9262261

Browse files
authored
Check the exit code of API v5 tests also (#7148)
1 parent 8ac2ed1 commit 9262261

File tree

1 file changed

+11
-6
lines changed
  • infrastructure/cdn-in-a-box/traffic_ops_integration_test

1 file changed

+11
-6
lines changed

infrastructure/cdn-in-a-box/traffic_ops_integration_test/run.sh

+11-6
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,23 @@ done
4040
# if [[ -x ]]; then;./config.sh; done traffic_ops/run-go.sh
4141
source config.sh
4242

43-
exit_code=0
43+
failed=0
44+
4445
for api_version in v{3..5}; do
4546
./traffic_ops_${api_version}_integration_test -test.v -cfg=traffic-ops-test.conf -fixtures=tc-fixtures-${api_version}.json 2>&1 | ./go-junit-report --package-name=golang.test.toapi.${api_version} --set-exit-code > /junit/golang.test.toapi.${api_version}.xml && find /junit -type 'f' | xargs chmod 664
46-
declare ${api_version}_exit_code=$?
47+
exit_code_var=${api_version}_exit_code
48+
declare ${exit_code_var}=$?
49+
cat /junit/golang.test.toapi.${api_version}.xml
50+
if [[ ${!exit_code_var} -ne 0 ]]; then
51+
echo "TO API ${api_version} tests failed"
52+
failed=1
53+
fi
4754
done
4855

49-
cat /junit/golang.test.toapi.v{3..5}.xml
50-
51-
52-
if [[ $v3_exit_code -eq 0 && $v4_exit_code -eq 0 ]]; then
56+
if [[ $failed -eq 0 ]]; then
5357
echo "TO API tests success"
5458
else
5559
echo "TO API tests failed"
5660
exit 1
5761
fi
62+

0 commit comments

Comments
 (0)