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

Attempt to fix the unit test bug #121

Merged
merged 3 commits into from
Dec 29, 2021
Merged

Attempt to fix the unit test bug #121

merged 3 commits into from
Dec 29, 2021

Conversation

dgkanatsios
Copy link
Collaborator

@dgkanatsios dgkanatsios commented Dec 25, 2021

Fixes #118

@dgkanatsios dgkanatsios marked this pull request as ready for review December 27, 2021 17:22
@@ -191,6 +191,13 @@ func verifyGameServerBuild(ctx context.Context, buildID, buildName string, state
return fmt.Errorf("expected %d crashes, got %d", state.crashesCount, gameServerBuild.Status.CrashesCount)
}

// 5 is the default, we should parameterize that
if gameServerBuild.Status.CrashesCount >= 5 && gameServerBuild.Status.Health != "Unhealthy" {
return fmt.Errorf("expected %s health, got %s", "Unhealthy", gameServerBuild.Status.Health)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return fmt.Errorf("expected %s health, got %s", "Unhealthy", gameServerBuild.Status.Health)
return fmt.Errorf("expected %s status, got %s", "Unhealthy", gameServerBuild.Status.Health)

if gameServerBuild.Status.CrashesCount >= 5 && gameServerBuild.Status.Health != "Unhealthy" {
return fmt.Errorf("expected %s health, got %s", "Unhealthy", gameServerBuild.Status.Health)
} else if gameServerBuild.Status.CrashesCount < 5 && gameServerBuild.Status.Health != "Healthy" {
return fmt.Errorf("expected %s health, got %s", "Healthy", gameServerBuild.Status.Health)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return fmt.Errorf("expected %s health, got %s", "Healthy", gameServerBuild.Status.Health)
return fmt.Errorf("expected %s status, got %s", "Healthy", gameServerBuild.Status.Health)

Copy link
Collaborator

@khaines khaines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one minor suggestion on wording

@dgkanatsios dgkanatsios merged commit 23e64bd into master Dec 29, 2021
@dgkanatsios dgkanatsios deleted the fixunhealthy branch December 29, 2021 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix setting GameServerBuild to Unhealthy
2 participants