From 5aa7615ec93335a922361728881ab1224a6e9266 Mon Sep 17 00:00:00 2001 From: Nicolas Lacasse Date: Wed, 20 Jun 2018 13:19:29 -0700 Subject: Kokoro: Change name of uploaded log files. PiperOrigin-RevId: 201404066 Change-Id: I8a0f2405d0192d412386592c1872a67582921b12 --- kokoro/gcp_ubuntu/continuous.cfg | 2 +- kokoro/gcp_ubuntu/presubmit.cfg | 2 +- 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} -- cgit v1.2.3