This is an automated email from the ASF dual-hosted git repository.
shamrick pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new 9262261eb3 Check the exit code of API v5 tests also (#7148)
9262261eb3 is described below
commit 9262261eb39e72a51bbe74d3a89d0f6ec89b5d51
Author: Zach Hoffman <[email protected]>
AuthorDate: Wed Oct 19 17:47:33 2022 +0000
Check the exit code of API v5 tests also (#7148)
---
.../cdn-in-a-box/traffic_ops_integration_test/run.sh | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/infrastructure/cdn-in-a-box/traffic_ops_integration_test/run.sh
b/infrastructure/cdn-in-a-box/traffic_ops_integration_test/run.sh
index 87861b57eb..2bce856a41 100755
--- a/infrastructure/cdn-in-a-box/traffic_ops_integration_test/run.sh
+++ b/infrastructure/cdn-in-a-box/traffic_ops_integration_test/run.sh
@@ -40,18 +40,23 @@ done
# if [[ -x ]]; then;./config.sh; done traffic_ops/run-go.sh
source config.sh
-exit_code=0
+failed=0
+
for api_version in v{3..5}; do
./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
- declare ${api_version}_exit_code=$?
+ exit_code_var=${api_version}_exit_code
+ declare ${exit_code_var}=$?
+ cat /junit/golang.test.toapi.${api_version}.xml
+ if [[ ${!exit_code_var} -ne 0 ]]; then
+ echo "TO API ${api_version} tests failed"
+ failed=1
+ fi
done
-cat /junit/golang.test.toapi.v{3..5}.xml
-
-
-if [[ $v3_exit_code -eq 0 && $v4_exit_code -eq 0 ]]; then
+if [[ $failed -eq 0 ]]; then
echo "TO API tests success"
else
echo "TO API tests failed"
exit 1
fi
+