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

Test NodeJS image #3498

Merged
merged 12 commits into from
Nov 14, 2023
38 changes: 38 additions & 0 deletions test/e2e/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,41 @@ func TestRustGameServerReady(t *testing.T) {
// Assert that the GameServer is in the expected state
assert.Equal(t, agonesv1.GameServerStateReady, readyGs.Status.State)
}

func TestNodeJSGameServerReady(t *testing.T) {
t.Parallel()
gs := &agonesv1.GameServer{
ObjectMeta: metav1.ObjectMeta{
GenerateName: "nodejs-simple-",
},
Spec: agonesv1.GameServerSpec{
Ports: []agonesv1.GameServerPort{{
Name: "default",
PortPolicy: agonesv1.Dynamic,
ContainerPort: 7654,
Protocol: corev1.ProtocolUDP,
}},
Health: agonesv1.Health{
InitialDelaySeconds: 30,
markmandel marked this conversation as resolved.
Show resolved Hide resolved
PeriodSeconds: 25,
},
Template: corev1.PodTemplateSpec{
Spec: corev1.PodSpec{
Containers: []corev1.Container{
{
Name: "nodejs-simple",
Image: "us-docker.pkg.dev/agones-images/examples/nodejs-simple-server:0.9",
},
},
},
},
},
}

// Use the e2e framework's function to create the GameServer and wait until it's ready
readyGs, err := framework.CreateGameServerAndWaitUntilReady(t, framework.Namespace, gs)
require.NoError(t, err)

// Assert that the GameServer is in the expected state
assert.Equal(t, agonesv1.GameServerStateReady, readyGs.Status.State)
}