Skip to content

Commit 7222ba6

Browse files
committed
tests: add debug information for failing tests
bats doesn't automatically print the entirety of $output when an error has occurred in a test. This makes debugging much harder, so add to the runc wrapper some more debug information to make maintainers' lives easier. Signed-off-by: Aleksa Sarai <[email protected]>
1 parent ab10b60 commit 7222ba6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/integration/helpers.bash

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ ROOT="$BATS_TMPDIR/runc"
3131
# Wrapper for runc.
3232
function runc() {
3333
run __runc "$@"
34+
35+
# Some debug information to make life easier. bats will only print it if the
36+
# test failed, in which case the output is useful.
37+
echo "runc $@ (status=$status):" >&2
38+
echo "$output" >&2
3439
}
3540

3641
# Raw wrapper for runc.

0 commit comments

Comments
 (0)