Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding a method to facilitate better test logging #351

Merged
merged 1 commit into from
Jul 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion cmd/e2e/utilities_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,12 @@ func verifyPods(ctx context.Context, kubeClient client.Client, state buildState)
if observedCount == state.podRunningCount {
return nil
}
return fmt.Errorf("Expecting %d Pods in state Running, got %d", state.podRunningCount, observedCount)
// get a []string with all Pod states
var observedStates []string
for _, pod := range pods.Items {
observedStates = append(observedStates, fmt.Sprintf("%s:%s", pod.Name, pod.Status.Phase))
}
return fmt.Errorf("Expecting %d Pods in state Running, got %d. Pod states: %v", state.podRunningCount, observedCount, observedStates)
}

// verifyGameServerDetail checks if the GameServerDetail CR is valid and has the appropriate state
Expand Down