Skip to content

Commit

Permalink
test/e2e: improve debugging of pods (DoTestNginxDeployment)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
wainersm authored and stevenhorsman committed Dec 11, 2024
1 parent d2ad316 commit c76f2fa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/cloud-api-adaptor/test/e2e/nginx_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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("===================")
}
}
Expand Down

0 comments on commit c76f2fa

Please sign in to comment.