Skip to content

Commit

Permalink
Merge pull request #2208 from sergiitk/xds-interop-buildscript-enable…
Browse files Browse the repository at this point in the history
…-logs

xDS interop: enable pod log collection in the buildscripts
  • Loading branch information
murgatroid99 committed Aug 29, 2022
2 parents a56e0fc + 594933a commit 6ba49a1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
8 changes: 7 additions & 1 deletion packages/grpc-js-xds/scripts/xds_k8s_lb.sh
Expand Up @@ -98,6 +98,8 @@ run_test() {
# Test driver usage:
# https://github.com/grpc/grpc/tree/master/tools/run_tests/xds_k8s_test_driver#basic-usage
local test_name="${1:?Usage: run_test test_name}"
local out_dir="${TEST_XML_OUTPUT_DIR}/${test_name}"
mkdir -pv "${out_dir}"
# testing_version is used by the framework to determine the supported PSM
# features. It's captured from Kokoro job name of the Node repo, which takes
# the form:
Expand All @@ -109,7 +111,11 @@ run_test() {
--client_image="${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
--server_image="${SERVER_IMAGE_NAME}" \
--testing_version="${TESTING_VERSION}" \
--xml_output_file="${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml"
--force_cleanup \
--collect_app_logs \
--log_dir="${out_dir}" \
--xml_output_file="${out_dir}/sponge_log.xml" \
|& tee "${out_dir}/sponge_log.log"
}

#######################################
Expand Down
10 changes: 7 additions & 3 deletions packages/grpc-js-xds/scripts/xds_k8s_url_map.sh
Expand Up @@ -98,15 +98,19 @@ run_test() {
# Test driver usage:
# https://github.com/grpc/grpc/tree/master/tools/run_tests/xds_k8s_test_driver#basic-usage
local test_name="${1:?Usage: run_test test_name}"
local out_dir="${TEST_XML_OUTPUT_DIR}/${test_name}"
mkdir -pv "${out_dir}"
set -x
python3 -m "tests.${test_name}" \
--flagfile="${TEST_DRIVER_FLAGFILE}" \
--flagfile="config/url-map.cfg" \
--kube_context="${KUBE_CONTEXT}" \
--client_image="${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" \
--testing_version="${TESTING_VERSION}" \
--xml_output_file="${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml" \
--flagfile="config/url-map.cfg"
set +x
--collect_app_logs \
--log_dir="${out_dir}" \
--xml_output_file="${out_dir}/sponge_log.xml" \
|& tee "${out_dir}/sponge_log.log"
}

#######################################
Expand Down
2 changes: 1 addition & 1 deletion test/kokoro/xds_k8s_lb.cfg
Expand Up @@ -20,7 +20,7 @@ timeout_mins: 180
action {
define_artifacts {
regex: "artifacts/**/*sponge_log.xml"
regex: "artifacts/**/*sponge_log.log"
regex: "artifacts/**/*.log"
strip_prefix: "artifacts"
}
}
2 changes: 1 addition & 1 deletion test/kokoro/xds_k8s_url_map.cfg
Expand Up @@ -20,7 +20,7 @@ timeout_mins: 180
action {
define_artifacts {
regex: "artifacts/**/*sponge_log.xml"
regex: "artifacts/**/*sponge_log.log"
regex: "artifacts/**/*.log"
strip_prefix: "artifacts"
}
}

0 comments on commit 6ba49a1

Please sign in to comment.