From 3795dd41aefc833e5647d397baf8712af89278b5 Mon Sep 17 00:00:00 2001 From: "Paul \"TBBle\" Hampson" Date: Tue, 28 Jul 2020 22:33:59 +1000 Subject: [PATCH] Always report server log from verbose integration test runs If you're adding `-v` to TESTFLAGS, you probably want to see the server logs, as well as the extra output from the testing framework. Signed-off-by: Paul "TBBle" Hampson --- client_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client_test.go b/client_test.go index be57edde8..4d6ff964b 100644 --- a/client_test.go +++ b/client_test.go @@ -169,8 +169,9 @@ func TestMain(m *testing.M) { fmt.Fprintln(os.Stderr, "failed to remove test root dir", err) os.Exit(1) } - // only print containerd logs if the test failed - if status != 0 { + + // only print containerd logs if the test failed or tests were run with -v + if status != 0 || testing.Verbose() { fmt.Fprintln(os.Stderr, buf.String()) } }