Skip to content

Commit 594933a

Browse files
committed
xDS interop: enable pod log collection in the buildscripts
- Enables pod log collection in all PSM interop jobs implemented in grpc/grpc#30594. - Associate test suite runs with their own log file, so it's displayed on the "Target Log" tab - Adds missing `--force_cleanup` to the lb test (reduces leaked resources) - Fix run_test not returning correct exit status, causing false positives in some cases. See grpc/grpc#30768
1 parent a56e0fc commit 594933a

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

‎packages/grpc-js-xds/scripts/xds_k8s_lb.sh‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ run_test() {
9898
# Test driver usage:
9999
# https://github.com/grpc/grpc/tree/master/tools/run_tests/xds_k8s_test_driver#basic-usage
100100
local test_name="${1:?Usage: run_test test_name}"
101+
local out_dir="${TEST_XML_OUTPUT_DIR}/${test_name}"
102+
mkdir -pv "${out_dir}"
101103
# testing_version is used by the framework to determine the supported PSM
102104
# features. It's captured from Kokoro job name of the Node repo, which takes
103105
# the form:
@@ -109,7 +111,11 @@ run_test() {
109111
--client_image="${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
110112
--server_image="${SERVER_IMAGE_NAME}" \
111113
--testing_version="${TESTING_VERSION}" \
112-
--xml_output_file="${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml"
114+
--force_cleanup \
115+
--collect_app_logs \
116+
--log_dir="${out_dir}" \
117+
--xml_output_file="${out_dir}/sponge_log.xml" \
118+
|& tee "${out_dir}/sponge_log.log"
113119
}
114120

115121
#######################################

‎packages/grpc-js-xds/scripts/xds_k8s_url_map.sh‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,19 @@ run_test() {
9898
# Test driver usage:
9999
# https://github.com/grpc/grpc/tree/master/tools/run_tests/xds_k8s_test_driver#basic-usage
100100
local test_name="${1:?Usage: run_test test_name}"
101+
local out_dir="${TEST_XML_OUTPUT_DIR}/${test_name}"
102+
mkdir -pv "${out_dir}"
101103
set -x
102104
python3 -m "tests.${test_name}" \
103105
--flagfile="${TEST_DRIVER_FLAGFILE}" \
106+
--flagfile="config/url-map.cfg" \
104107
--kube_context="${KUBE_CONTEXT}" \
105108
--client_image="${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
106109
--testing_version="${TESTING_VERSION}" \
107-
--xml_output_file="${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml" \
108-
--flagfile="config/url-map.cfg"
109-
set +x
110+
--collect_app_logs \
111+
--log_dir="${out_dir}" \
112+
--xml_output_file="${out_dir}/sponge_log.xml" \
113+
|& tee "${out_dir}/sponge_log.log"
110114
}
111115

112116
#######################################

‎test/kokoro/xds_k8s_lb.cfg‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ timeout_mins: 180
2020
action {
2121
define_artifacts {
2222
regex: "artifacts/**/*sponge_log.xml"
23-
regex: "artifacts/**/*sponge_log.log"
23+
regex: "artifacts/**/*.log"
2424
strip_prefix: "artifacts"
2525
}
2626
}

‎test/kokoro/xds_k8s_url_map.cfg‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ timeout_mins: 180
2020
action {
2121
define_artifacts {
2222
regex: "artifacts/**/*sponge_log.xml"
23-
regex: "artifacts/**/*sponge_log.log"
23+
regex: "artifacts/**/*.log"
2424
strip_prefix: "artifacts"
2525
}
2626
}

0 commit comments

Comments
 (0)