From 0dde4cd18a618e12b8312c40de05fdc6d2bf587f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mochol=C3=AD?= Date: Sat, 5 Nov 2022 03:08:22 +0100 Subject: [PATCH] Print the logs when TPU tests fail (#15533) (cherry picked from commit 7a8cf4eb101ad429ab5a3f0d80bce608f51286d5) --- .github/workflows/tpu-tests.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tpu-tests.yml b/.github/workflows/tpu-tests.yml index 3aea5061ac6b7..a7ffe3e10afe0 100644 --- a/.github/workflows/tpu-tests.yml +++ b/.github/workflows/tpu-tests.yml @@ -101,10 +101,15 @@ jobs: done echo "Done waiting. Job status code: $status_code" kubectl logs -f $pod_name --container=train > /tmp/full_output.txt - grep '' /tmp/full_output.txt # sanity check - csplit /tmp/full_output.txt '//' - cat xx00 # test logs - mv xx01 coverage.xml + if grep -q '' /tmp/full_output.txt; then + # successful run. split the output into logs + coverage report + csplit /tmp/full_output.txt '//'; + cat xx00 # test logs + mv xx01 coverage.xml + else + # failed run, print everything + cat /tmp/full_output.txt; + fi exit $status_code shell: bash