Skip to content

Commit

Permalink
xDS interop: buildscripts: fix run_test return status (#30768) (#30875)
Browse files Browse the repository at this point in the history
To capture the return status of the test in run_test the last command must be the call to the test itself.
This removes `set +x`, which makes the run_test always return success, and not propagate the test status.

I can't find it, but this exact error bit us before. Looks like it leaked to other scripts.
The good thing is if the test was executed, it's failure would still be picked up from the result xml.

However, if the test framework didn't start in the first place, the result will be false positive.
Example: https://source.cloud.google.com/results/invocations/98d3e679-ec8a-40bd-9f36-88179747b0d6/targets

```
/home/kbuilder/.pyenv/versions/k8s_xds_test_runner/bin/python3: Error while finding module specification for 'tests.authz_test' (ModuleNotFoundError: No module named 'tests')
+ set +x
Failed test suites: 0

[ID: 3548168] Command finished after 625 secs, exit value: 0
```
  • Loading branch information
sergiitk committed Sep 8, 2022
1 parent ef66748 commit babe805
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 3 deletions.
1 change: 0 additions & 1 deletion tools/internal_ci/linux/grpc_xds_url_map.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ run_test() {
--log_dir="${out_dir}" \
--xml_output_file="${out_dir}/sponge_log.xml" \
|& tee "${out_dir}/sponge_log.log"
set +x
}

#######################################
Expand Down
1 change: 0 additions & 1 deletion tools/internal_ci/linux/grpc_xds_url_map_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ run_test() {
--log_dir="${out_dir}" \
--xml_output_file="${out_dir}/sponge_log.xml" \
|& tee "${out_dir}/sponge_log.log"
set +x
}

#######################################
Expand Down
1 change: 0 additions & 1 deletion tools/internal_ci/linux/psm-security.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ run_test() {
--log_dir="${out_dir}" \
--xml_output_file="${out_dir}/sponge_log.xml" \
|& tee "${out_dir}/sponge_log.log"
set +x
}

#######################################
Expand Down

0 comments on commit babe805

Please sign in to comment.