summaryrefslogtreecommitdiffhomepage
path: root/kokoro/gcp_ubuntu/run_tests.sh
diff options
context:
space:
mode:
Diffstat (limited to 'kokoro/gcp_ubuntu/run_tests.sh')
-rwxr-xr-xkokoro/gcp_ubuntu/run_tests.sh15
1 files changed, 7 insertions, 8 deletions
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}