From c76f2fad9d723f51a1d38ca3c8312248f680b569 Mon Sep 17 00:00:00 2001 From: Wainer dos Santos Moschetta Date: Tue, 17 Sep 2024 18:26:58 -0300 Subject: [PATCH] test/e2e: improve debugging of pods (DoTestNginxDeployment) Fixed the printing of the pod name. Also will print an user-friendly message when there isn't any pod logs to show. Signed-off-by: Wainer dos Santos Moschetta --- src/cloud-api-adaptor/test/e2e/nginx_deployment.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cloud-api-adaptor/test/e2e/nginx_deployment.go b/src/cloud-api-adaptor/test/e2e/nginx_deployment.go index 80a2f3bfd..e5d234a3f 100644 --- a/src/cloud-api-adaptor/test/e2e/nginx_deployment.go +++ b/src/cloud-api-adaptor/test/e2e/nginx_deployment.go @@ -183,10 +183,14 @@ func waitForNginxDeploymentAvailable(ctx context.Context, t *testing.T, client k t.Logf("Current Pod State: %v", string(yamlData)) } if pod.Status.Phase == v1.PodRunning { - t.Logf("Log of the pod %.v", pod.Name) + t.Logf("Log of the pod %v", pod.Name) t.Logf("===================") podLogString, _ := GetPodLog(ctx, client, &pod) - t.Logf(podLogString) + if podLogString != "" { + t.Logf(podLogString) + } else { + t.Logf("No logs found") + } t.Logf("===================") } }