diff --git a/.github/workflows/tpu-tests.yml b/.github/workflows/tpu-tests.yml index ac9046b8b1b94..9f8527d7ef65e 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