Skip to content

Commit

Permalink
xds interop: Fix buildscripts not continuing on a failed test suite (#…
Browse files Browse the repository at this point in the history
…32093) (#32117)

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.
  • Loading branch information
sergiitk committed Jan 17, 2023
1 parent 684e122 commit 8326882
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tools/internal_ci/linux/grpc_xds_k8s_lb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" "outlier_detection_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
Expand Down
2 changes: 1 addition & 1 deletion tools/internal_ci/linux/grpc_xds_k8s_lb_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" "outlier_detection_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
Expand Down
2 changes: 1 addition & 1 deletion tools/internal_ci/linux/psm-security-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ main() {
local failed_tests=0
test_suites=("baseline_test" "security_test" "authz_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
Expand Down
2 changes: 1 addition & 1 deletion tools/internal_ci/linux/psm-security.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ main() {
local failed_tests=0
test_suites=("baseline_test" "security_test" "authz_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
Expand Down

0 comments on commit 8326882

Please sign in to comment.