From 194b8cd7d8261908ec22f925b009ef2c2fc2fbee Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Wed, 8 Apr 2020 15:34:16 -0700 Subject: [PATCH] Modify post-mortem logs so I don't need to count dashes --- test/integration/helpers.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/test/integration/helpers.go b/test/integration/helpers.go index 8304e879ed..2ec166a4ac 100644 --- a/test/integration/helpers.go +++ b/test/integration/helpers.go @@ -201,9 +201,9 @@ func clusterLogs(t *testing.T, profile string) { return } - t.Logf("-----------------------post-mortem--------------------------------") + t.Logf("------------------------------------------------------------------") t.Logf("<<< %s FAILED: start of post-mortem logs <<<", t.Name()) - t.Logf("-------------------post-mortem minikube logs----------------------") + t.Logf("------++> post-mortem[%s]: minikube logs", t.Name()) rr, err := Run(t, exec.Command(Target(), "-p", profile, "logs", "--problems")) if err != nil { @@ -212,21 +212,20 @@ func clusterLogs(t *testing.T, profile string) { } t.Logf("%s logs: %s", t.Name(), rr.Output()) - t.Logf("------------------post-mortem disk usage-------------------") + t.Logf("------++> post-mortem[%s]: disk usage", t.Name()) rr, err = Run(t, exec.Command(Target(), "-p", profile, "ssh", "df -h /var/lib/docker/overlay2 /var /; du -hs /var/lib/docker/overlay2")) if err != nil { t.Logf("failed df error: %v", err) } t.Logf("%s df: %s", t.Name(), rr.Stdout) - t.Logf("------------------post-mortem api server status-------------------") st = Status(context.Background(), t, Target(), profile, "APIServer") if st != state.Running.String() { t.Logf("%q apiserver is not running, skipping kubectl commands (state=%q)", profile, st) return } - t.Logf("--------------------post-mortem get pods--------------------------") + t.Logf("------++> post-mortem[%s]: get pods", t.Name()) rr, rerr := Run(t, exec.Command("kubectl", "--context", profile, "get", "po", "-A", "--show-labels")) if rerr != nil { t.Logf("%s: %v", rr.Command(), rerr) @@ -234,7 +233,7 @@ func clusterLogs(t *testing.T, profile string) { } t.Logf("(dbg) %s:\n%s", rr.Command(), rr.Output()) - t.Logf("-------------------post-mortem describe node----------------------") + t.Logf("------++> post-mortem[%s]: describe node", t.Name()) rr, err = Run(t, exec.Command("kubectl", "--context", profile, "describe", "node")) if err != nil { t.Logf("%s: %v", rr.Command(), err) @@ -242,7 +241,7 @@ func clusterLogs(t *testing.T, profile string) { t.Logf("(dbg) %s:\n%s", rr.Command(), rr.Output()) } - t.Logf("-------------------post-mortem describe pods----------------------") + t.Logf("------++> post-mortem[%s]: describe pods", t.Name()) rr, err = Run(t, exec.Command("kubectl", "--context", profile, "describe", "po", "-A")) if err != nil { t.Logf("%s: %v", rr.Command(), err) @@ -250,7 +249,6 @@ func clusterLogs(t *testing.T, profile string) { t.Logf("(dbg) %s:\n%s", rr.Command(), rr.Stdout) } - t.Logf("------------------------------------------------------------------") t.Logf("<<< %s FAILED: end of post-mortem logs <<<", t.Name()) t.Logf("---------------------/post-mortem---------------------------------") }