Skip to content

Commit a46b60e

Browse files
pb8oroypat
authored andcommitted
ci: output disk usage if tests fail
Sometimes test fail because of running out of space. In that case it would be helpful to dump some information on disk usage. Signed-off-by: Pablo Barbáchano <[email protected]>
1 parent 3c9b236 commit a46b60e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tools/test.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,14 @@ cp -ruvf build/img /srv
3737
cd tests
3838
export PYTEST_ADDOPTS="${PYTEST_ADDOPTS:-} --pdbcls=IPython.terminal.debugger:TerminalPdb"
3939
pytest "$@"
40-
exit $?
40+
ret=$?
41+
42+
# if the tests failed and we are running in CI, print some disk usage stats
43+
# to help troubleshooting
44+
if [ $ret != 0 ] && [ "$BUILDKITE" == "true" ]; then
45+
df -ih
46+
df -h
47+
du -h / 2>/dev/null |sort -h |tail -32
48+
fi
49+
50+
exit $ret

0 commit comments

Comments
 (0)