diff options
author | Nicolas Lacasse <nlacasse@google.com> | 2018-06-20 13:19:29 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-06-20 13:20:36 -0700 |
commit | 5aa7615ec93335a922361728881ab1224a6e9266 (patch) | |
tree | 106c4c70dc2a495024dff5aee8f326c77a42cfcc /kokoro/gcp_ubuntu | |
parent | d93f55e863c598de9126a0316a813f872b11e29f (diff) |
Kokoro: Change name of uploaded log files.
PiperOrigin-RevId: 201404066
Change-Id: I8a0f2405d0192d412386592c1872a67582921b12
Diffstat (limited to 'kokoro/gcp_ubuntu')
-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} |