diff options
author | Sergii Tkachenko <sergiitk@google.com> | 2023-01-17 18:46:49 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-17 15:46:49 -0800 |
commit | eeae8e635a896bfa420d21e476221af652fd9986 (patch) | |
tree | 0148149e81c768fa88af651a68eaac6e22d4390d | |
parent | 9ad736c84ddcf95d56c3423e190b197f63be7c6a (diff) | |
download | grpc-grpc-upstream-v1.43.x.tar.gz |
xds interop: Fix buildscripts not continuing on a failed test suite (#32093) (#32125)upstream-v1.43.x
Apparently there's a difference between bash 3 and bash 4. OSX comes with bash 3 out-of-box, so for whoever wrote this logic it "worked on my machine".
The `((` construct returns a 0 exit code if the value is non-zero. Since the value starts at 0 and we do a post-increment, it will always fail the first time. Changing it to a pre-increment should fix it.
-rwxr-xr-x | tools/internal_ci/linux/grpc_xds_k8s_lb.sh | 4 | ||||
-rwxr-xr-x | tools/internal_ci/linux/grpc_xds_k8s_lb_python.sh | 2 | ||||
-rwxr-xr-x | tools/internal_ci/linux/psm-security-python.sh | 2 | ||||
-rwxr-xr-x | tools/internal_ci/linux/psm-security.sh | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/tools/internal_ci/linux/grpc_xds_k8s_lb.sh b/tools/internal_ci/linux/grpc_xds_k8s_lb.sh index 7c7537770b..0b7b557140 100755 --- a/tools/internal_ci/linux/grpc_xds_k8s_lb.sh +++ b/tools/internal_ci/linux/grpc_xds_k8s_lb.sh @@ -168,10 +168,10 @@ main() { # Run tests cd "${TEST_DRIVER_FULL_DIR}" local failed_tests=0 - run_alpha_test subsetting_test || (( failed_tests++ )) + run_alpha_test subsetting_test || (( ++failed_tests )) test_suites=("api_listener_test" "change_backend_service_test" "failover_test" "remove_neg_test" "round_robin_test" "affinity_test") for test in "${test_suites[@]}"; do - run_test $test || (( failed_tests++ )) + run_test $test || (( ++failed_tests )) done echo "Failed test suites: ${failed_tests}" if (( failed_tests > 0 )); then diff --git a/tools/internal_ci/linux/grpc_xds_k8s_lb_python.sh b/tools/internal_ci/linux/grpc_xds_k8s_lb_python.sh index 6105cf9f76..4a8e91a641 100755 --- a/tools/internal_ci/linux/grpc_xds_k8s_lb_python.sh +++ b/tools/internal_ci/linux/grpc_xds_k8s_lb_python.sh @@ -176,7 +176,7 @@ main() { local failed_tests=0 test_suites=("api_listener_test" "change_backend_service_test" "failover_test" "remove_neg_test" "round_robin_test") for test in "${test_suites[@]}"; do - run_test $test || (( failed_tests++ )) + run_test $test || (( ++failed_tests )) done echo "Failed test suites: ${failed_tests}" if (( failed_tests > 0 )); then diff --git a/tools/internal_ci/linux/psm-security-python.sh b/tools/internal_ci/linux/psm-security-python.sh index 5781388cbe..a348ee1530 100755 --- a/tools/internal_ci/linux/psm-security-python.sh +++ b/tools/internal_ci/linux/psm-security-python.sh @@ -176,7 +176,7 @@ main() { local failed_tests=0 test_suites=("baseline_test" "security_test") for test in "${test_suites[@]}"; do - run_test $test || (( failed_tests++ )) + run_test $test || (( ++failed_tests )) done echo "Failed test suites: ${failed_tests}" if (( failed_tests > 0 )); then diff --git a/tools/internal_ci/linux/psm-security.sh b/tools/internal_ci/linux/psm-security.sh index 72eb110fb3..5df96c20dd 100755 --- a/tools/internal_ci/linux/psm-security.sh +++ b/tools/internal_ci/linux/psm-security.sh @@ -160,7 +160,7 @@ main() { local failed_tests=0 test_suites=("baseline_test" "security_test") for test in "${test_suites[@]}"; do - run_test $test || (( failed_tests++ )) + run_test $test || (( ++failed_tests )) done echo "Failed test suites: ${failed_tests}" if (( failed_tests > 0 )); then |