diff options
-rw-r--r-- | kokoro/gcp_ubuntu/continuous.cfg | 2 | ||||
-rw-r--r-- | kokoro/gcp_ubuntu/presubmit.cfg | 2 | ||||
-rwxr-xr-x | kokoro/gcp_ubuntu/run_tests.sh | 15 |
3 files changed, 9 insertions, 10 deletions
diff --git a/kokoro/gcp_ubuntu/continuous.cfg b/kokoro/gcp_ubuntu/continuous.cfg index e4dfb8d5e..e6552753c 100644 --- a/kokoro/gcp_ubuntu/continuous.cfg +++ b/kokoro/gcp_ubuntu/continuous.cfg @@ -6,6 +6,6 @@ build_file: "repo/kokoro/gcp_ubuntu/run_tests.sh" action { define_artifacts { regex: "**/sponge_log.xml" - regex: "**/test.log" + regex: "**/sponge_log.log" } } diff --git a/kokoro/gcp_ubuntu/presubmit.cfg b/kokoro/gcp_ubuntu/presubmit.cfg index e4dfb8d5e..e6552753c 100644 --- a/kokoro/gcp_ubuntu/presubmit.cfg +++ b/kokoro/gcp_ubuntu/presubmit.cfg @@ -6,6 +6,6 @@ build_file: "repo/kokoro/gcp_ubuntu/run_tests.sh" action { define_artifacts { regex: "**/sponge_log.xml" - regex: "**/test.log" + regex: "**/sponge_log.log" } } diff --git a/kokoro/gcp_ubuntu/run_tests.sh b/kokoro/gcp_ubuntu/run_tests.sh index 8bc0ecade..ce458be9c 100755 --- a/kokoro/gcp_ubuntu/run_tests.sh +++ b/kokoro/gcp_ubuntu/run_tests.sh @@ -40,15 +40,14 @@ bazel test --test_output=errors //... exit_code=${?} set -e -# Find and rename all test logs so that Sponge can pick them up. -for file in $(find -L "bazel-testlogs" -name "test.xml"); do +# Find and rename all test xml and log files so that Sponge can pick them up. +# XML files must be named sponge_log.xml, and log files must be named +# sponge_log.log. We move all such files into KOKORO_ARTIFACTS_DIR, in a +# subdirectory named with the test name. +for file in $(find -L "bazel-testlogs" -name "test.xml" -o -name "test.log"); do newpath=${KOKORO_ARTIFACTS_DIR}/$(dirname ${file}) - # XML logs must be named sponge_log.xml for sponge to process them. - mkdir -p "${newpath}" && cp "${file}" "${newpath}/sponge_log.xml" -done -for file in $(find -L "bazel-testlogs" -name "test.log"); do - newpath=${KOKORO_ARTIFACTS_DIR}/$(dirname ${file}) - mkdir -p "${newpath}" && cp "${file}" "${newpath}" + extension="${file##*.}" + mkdir -p "${newpath}" && cp "${file}" "${newpath}/sponge_log.${extension}" done exit ${exit_code} |