Skip to content

Commit 0dde4cd

Browse files
carmoccalexierule
authored andcommitted
Print the logs when TPU tests fail (#15533)
(cherry picked from commit 7a8cf4e)
1 parent e3b9f04 commit 0dde4cd

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/tpu-tests.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,15 @@ jobs:
101101
done
102102
echo "Done waiting. Job status code: $status_code"
103103
kubectl logs -f $pod_name --container=train > /tmp/full_output.txt
104-
grep '<?xml version="1.0" ?>' /tmp/full_output.txt # sanity check
105-
csplit /tmp/full_output.txt '/<?xml version="1.0" ?>/'
106-
cat xx00 # test logs
107-
mv xx01 coverage.xml
104+
if grep -q '<?xml version="1.0" ?>' /tmp/full_output.txt; then
105+
# successful run. split the output into logs + coverage report
106+
csplit /tmp/full_output.txt '/<?xml version="1.0" ?>/';
107+
cat xx00 # test logs
108+
mv xx01 coverage.xml
109+
else
110+
# failed run, print everything
111+
cat /tmp/full_output.txt;
112+
fi
108113
exit $status_code
109114
shell: bash
110115

0 commit comments

Comments
 (0)