From 2477589022d4d2f8536399361954531c0d7ae654 Mon Sep 17 00:00:00 2001 From: Kalaiselvim <117940852+Kalaiselvi84@users.noreply.github.com> Date: Tue, 30 Jan 2024 16:05:30 +0000 Subject: [PATCH] Simple Game Server: Add \n to Counters and Lists Response (#3589) * Simple Game Server: Add \n to Counters and Lists Response * gofmt * Changes in functions * fine tuning * missing quotes * Change in listContains and getListValues * update main.go and gameserver_test.go files * NO Values for getListValues * review change * NO Values when list empty * update list contains * modify listContains and getListValues * Rename success with FOUND * Review changes * bump simple-game-server image * bump simple-game-server image outside example/simple-game-server * adjust expected value * update response for counters and lists in fleet_test.go * modify listContains * bump simple-game-server --- build/Makefile | 2 +- examples/crd-client/create-gs.yaml | 2 +- examples/fleet.yaml | 2 +- examples/gameserver.yaml | 2 +- examples/simple-game-server/Makefile | 4 +- examples/simple-game-server/README.md | 12 ++-- .../simple-game-server/dev-gameserver.yaml | 2 +- .../simple-game-server/fleet-distributed.yaml | 2 +- examples/simple-game-server/fleet-tcp.yaml | 2 +- examples/simple-game-server/fleet.yaml | 2 +- .../gameserver-passthrough.yaml | 2 +- .../gameserver-windows.yaml | 2 +- examples/simple-game-server/gameserver.yaml | 2 +- examples/simple-game-server/main.go | 44 ++++++++---- .../agones/templates/tests/test-runner.yaml | 2 +- pkg/util/webhooks/webhooks_test.go | 2 +- site/config.toml | 2 +- site/content/en/docs/Guides/fleet-updates.md | 2 +- test/e2e/fleet_test.go | 8 +-- test/e2e/framework/framework.go | 2 +- test/e2e/gameserver_test.go | 68 +++++++++---------- test/load/allocation/fleet.yaml | 2 +- .../performance-test-fleet-template.yaml | 2 +- test/load/allocation/scenario-fleet.yaml | 2 +- 24 files changed, 95 insertions(+), 79 deletions(-) diff --git a/build/Makefile b/build/Makefile index 7b78a202f5..a13d2fe9e3 100644 --- a/build/Makefile +++ b/build/Makefile @@ -61,7 +61,7 @@ KIND_PROFILE ?= agones KIND_CONTAINER_NAME=$(KIND_PROFILE)-control-plane # Game Server image to use while doing end-to-end tests -GS_TEST_IMAGE ?= us-docker.pkg.dev/agones-images/examples/simple-game-server:0.25 +GS_TEST_IMAGE ?= us-docker.pkg.dev/agones-images/examples/simple-game-server:0.27 # Enable all alpha feature gates. Keep in sync with `false` (alpha) entries in pkg/util/runtime/features.go:featureDefaults ALPHA_FEATURE_GATES ?= "PlayerAllocationFilter=true&PlayerTracking=true&CountsAndLists=true&DisableResyncOnSDKServer=true&Example=true" diff --git a/examples/crd-client/create-gs.yaml b/examples/crd-client/create-gs.yaml index 7d4c305843..1dce462f6f 100644 --- a/examples/crd-client/create-gs.yaml +++ b/examples/crd-client/create-gs.yaml @@ -38,5 +38,5 @@ spec: imagePullPolicy: Always env: - name: GAMESERVER_IMAGE - value: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.25 + value: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.27 restartPolicy: Never diff --git a/examples/fleet.yaml b/examples/fleet.yaml index e0c7c1fe2f..c759ec2d7b 100644 --- a/examples/fleet.yaml +++ b/examples/fleet.yaml @@ -117,4 +117,4 @@ spec: spec: containers: - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.25 + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.27 diff --git a/examples/gameserver.yaml b/examples/gameserver.yaml index 9d3a496870..62ebf5d00c 100644 --- a/examples/gameserver.yaml +++ b/examples/gameserver.yaml @@ -116,7 +116,7 @@ spec: spec: containers: - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.25 + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.27 imagePullPolicy: Always # nodeSelector is a label that can be used to tell Kubernetes which host # OS to use. For Windows game servers uncomment the nodeSelector diff --git a/examples/simple-game-server/Makefile b/examples/simple-game-server/Makefile index eb26842a6b..0e250ae1ab 100644 --- a/examples/simple-game-server/Makefile +++ b/examples/simple-game-server/Makefile @@ -39,9 +39,9 @@ WITH_ARM64 ?= 1 mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) project_path := $(dir $(mkfile_path)) ifeq ($(REPOSITORY),) - server_tag := simple-game-server:0.25 + server_tag := simple-game-server:0.27 else - server_tag := $(REPOSITORY)/simple-game-server:0.25 + server_tag := $(REPOSITORY)/simple-game-server:0.27 endif ifeq ($(WITH_WINDOWS), 1) diff --git a/examples/simple-game-server/README.md b/examples/simple-game-server/README.md index 6856c8d0e6..556de4aa08 100644 --- a/examples/simple-game-server/README.md +++ b/examples/simple-game-server/README.md @@ -39,12 +39,12 @@ There are some text commands you can send the server to affect its behavior: | "GET_COUNTER_CAPACITY" | Returns the Capacity of the given Counter | | "SET_COUNTER_CAPACITY" | Sets the Capacity of the given Counter to the given amount | | "GET_LIST_CAPACITY" | Returns the Capacity of the given List | -| "SET_LIST_CAPACITY | Returns if the List was set to a new Capacity successfully (true) or not (false) | -| "LIST_CONTAINS | Returns true if the given value is in the given List, false otherwise | -| "GET_LIST_LENGTH | Returns the length (number of values) of the given List as a string | -| "GET_LIST_VALUES | Return the values in the given List as a comma delineated string | -| "APPEND_LIST_VALUE | Returns if the given value was successfuly added to the List (true) or not (false) | -| "DELETE_LIST_VALUE | Rreturns if the given value was successfuly deleted from the List (true) or not (false) | +| "SET_LIST_CAPACITY" | Returns if the List was set to a new Capacity successfully (true) or not (false) | +| "LIST_CONTAINS" | Returns true if the given value is in the given List, false otherwise | +| "GET_LIST_LENGTH" | Returns the length (number of values) of the given List as a string | +| "GET_LIST_VALUES" | Return the values in the given List as a comma delineated string | +| "APPEND_LIST_VALUE" | Returns if the given value was successfuly added to the List (true) or not (false) | +| "DELETE_LIST_VALUE" | Rreturns if the given value was successfuly deleted from the List (true) or not (false) | ## Configuration diff --git a/examples/simple-game-server/dev-gameserver.yaml b/examples/simple-game-server/dev-gameserver.yaml index f87f438f45..85e23c69fe 100644 --- a/examples/simple-game-server/dev-gameserver.yaml +++ b/examples/simple-game-server/dev-gameserver.yaml @@ -31,4 +31,4 @@ spec: spec: containers: - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.25 + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.27 diff --git a/examples/simple-game-server/fleet-distributed.yaml b/examples/simple-game-server/fleet-distributed.yaml index f8a22ab58c..8d149bd79c 100644 --- a/examples/simple-game-server/fleet-distributed.yaml +++ b/examples/simple-game-server/fleet-distributed.yaml @@ -32,7 +32,7 @@ spec: spec: containers: - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.25 + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.27 resources: requests: memory: 64Mi diff --git a/examples/simple-game-server/fleet-tcp.yaml b/examples/simple-game-server/fleet-tcp.yaml index 9052c09ac2..45addead21 100644 --- a/examples/simple-game-server/fleet-tcp.yaml +++ b/examples/simple-game-server/fleet-tcp.yaml @@ -28,7 +28,7 @@ spec: spec: containers: - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.25 + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.27 env: # Disables the UDP listener (Enabled by default) - name: UDP diff --git a/examples/simple-game-server/fleet.yaml b/examples/simple-game-server/fleet.yaml index a79d4125b2..54a26cea70 100644 --- a/examples/simple-game-server/fleet.yaml +++ b/examples/simple-game-server/fleet.yaml @@ -27,7 +27,7 @@ spec: spec: containers: - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.25 + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.27 resources: requests: memory: 64Mi diff --git a/examples/simple-game-server/gameserver-passthrough.yaml b/examples/simple-game-server/gameserver-passthrough.yaml index 3666df193e..8575b06d00 100644 --- a/examples/simple-game-server/gameserver-passthrough.yaml +++ b/examples/simple-game-server/gameserver-passthrough.yaml @@ -24,7 +24,7 @@ spec: spec: containers: - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.25 + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.27 env: - name: PASSTHROUGH value: 'TRUE' diff --git a/examples/simple-game-server/gameserver-windows.yaml b/examples/simple-game-server/gameserver-windows.yaml index b2b1563c54..b465fdd819 100644 --- a/examples/simple-game-server/gameserver-windows.yaml +++ b/examples/simple-game-server/gameserver-windows.yaml @@ -25,7 +25,7 @@ spec: spec: containers: - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.25 + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.27 resources: requests: memory: 64Mi diff --git a/examples/simple-game-server/gameserver.yaml b/examples/simple-game-server/gameserver.yaml index 508d3ac97d..74a8a7b498 100644 --- a/examples/simple-game-server/gameserver.yaml +++ b/examples/simple-game-server/gameserver.yaml @@ -25,7 +25,7 @@ spec: spec: containers: - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.25 + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.27 resources: requests: memory: 64Mi diff --git a/examples/simple-game-server/main.go b/examples/simple-game-server/main.go index a808bd777f..b548f7a48d 100644 --- a/examples/simple-game-server/main.go +++ b/examples/simple-game-server/main.go @@ -687,8 +687,9 @@ func getCounterCount(s *sdk.SDK, counterName string) (string, error) { count, err := s.Alpha().GetCounterCount(counterName) if err != nil { log.Printf("Error getting Counter %s Count: %s", counterName, err) + return strconv.FormatInt(count, 10), err } - return strconv.FormatInt(count, 10), err + return "COUNTER: " + strconv.FormatInt(count, 10) + "\n", nil } // incrementCounter returns the if the Counter Count was incremented successfully (true) or not (false) @@ -701,8 +702,9 @@ func incrementCounter(s *sdk.SDK, counterName string, amount string) (string, er ok, err := s.Alpha().IncrementCounter(counterName, amountInt) if err != nil { log.Printf("Error incrementing Counter %s Count by amount %d: %s", counterName, amountInt, err) + return strconv.FormatBool(ok), err } - return strconv.FormatBool(ok), err + return "SUCCESS: " + strconv.FormatBool(ok) + "\n", nil } // decrementCounter returns the if the Counter Count was decremented successfully (true) or not (false) @@ -715,8 +717,9 @@ func decrementCounter(s *sdk.SDK, counterName string, amount string) (string, er ok, err := s.Alpha().DecrementCounter(counterName, amountInt) if err != nil { log.Printf("Error decrementing Counter %s Count by amount %d: %s", counterName, amountInt, err) + return strconv.FormatBool(ok), err } - return strconv.FormatBool(ok), err + return "SUCCESS: " + strconv.FormatBool(ok) + "\n", nil } // setCounterCount returns the if the Counter was set to a new Count successfully (true) or not (false) @@ -729,8 +732,9 @@ func setCounterCount(s *sdk.SDK, counterName string, amount string) (string, err ok, err := s.Alpha().SetCounterCount(counterName, amountInt) if err != nil { log.Printf("Error setting Counter %s Count by amount %d: %s", counterName, amountInt, err) + return strconv.FormatBool(ok), err } - return strconv.FormatBool(ok), err + return "SUCCESS: " + strconv.FormatBool(ok) + "\n", nil } // getCounterCapacity returns the Capacity of the given Counter as a string @@ -739,8 +743,9 @@ func getCounterCapacity(s *sdk.SDK, counterName string) (string, error) { count, err := s.Alpha().GetCounterCapacity(counterName) if err != nil { log.Printf("Error getting Counter %s Capacity: %s", counterName, err) + return strconv.FormatInt(count, 10), err } - return strconv.FormatInt(count, 10), err + return "CAPACITY: " + strconv.FormatInt(count, 10) + "\n", nil } // setCounterCapacity returns the if the Counter was set to a new Capacity successfully (true) or not (false) @@ -753,8 +758,9 @@ func setCounterCapacity(s *sdk.SDK, counterName string, amount string) (string, ok, err := s.Alpha().SetCounterCapacity(counterName, amountInt) if err != nil { log.Printf("Error setting Counter %s Capacity to amount %d: %s", counterName, amountInt, err) + return strconv.FormatBool(ok), err } - return strconv.FormatBool(ok), err + return "SUCCESS: " + strconv.FormatBool(ok) + "\n", nil } // getListCapacity returns the Capacity of the given List as a string @@ -763,8 +769,9 @@ func getListCapacity(s *sdk.SDK, listName string) (string, error) { capacity, err := s.Alpha().GetListCapacity(listName) if err != nil { log.Printf("Error getting List %s Capacity: %s", listName, err) + return strconv.FormatInt(capacity, 10), err } - return strconv.FormatInt(capacity, 10), err + return "CAPACITY: " + strconv.FormatInt(capacity, 10) + "\n", nil } // setListCapacity returns if the List was set to a new Capacity successfully (true) or not (false) @@ -777,8 +784,9 @@ func setListCapacity(s *sdk.SDK, listName string, amount string) (string, error) ok, err := s.Alpha().SetListCapacity(listName, amountInt) if err != nil { log.Printf("Error setting List %s Capacity to amount %d: %s", listName, amountInt, err) + return strconv.FormatBool(ok), err } - return strconv.FormatBool(ok), err + return "SUCCESS: " + strconv.FormatBool(ok) + "\n", nil } // listContains returns true if the given value is in the given List, false otherwise @@ -787,8 +795,9 @@ func listContains(s *sdk.SDK, listName string, value string) (string, error) { ok, err := s.Alpha().ListContains(listName, value) if err != nil { log.Printf("Error getting List %s contains value %s: %s", listName, value, err) - } - return strconv.FormatBool(ok), err + return strconv.FormatBool(ok), err + } + return "FOUND: " + strconv.FormatBool(ok) + "\n", nil } // getListLength returns the length (number of values) of the given List as a string @@ -797,8 +806,9 @@ func getListLength(s *sdk.SDK, listName string) (string, error) { length, err := s.Alpha().GetListLength(listName) if err != nil { log.Printf("Error getting List %s length: %s", listName, err) + return strconv.Itoa(length), err } - return strconv.Itoa(length), err + return "LENGTH: " + strconv.Itoa(length) + "\n", nil } // getListValues return the values in the given List as a comma delineated string @@ -807,8 +817,12 @@ func getListValues(s *sdk.SDK, listName string) (string, error) { values, err := s.Alpha().GetListValues(listName) if err != nil { log.Printf("Error getting List %s values: %s", listName, err) + return "INVALID LIST NAME", err } - return strings.Join(values, ",") + "\n", err + if len(values) > 0 { + return "VALUES: " + strings.Join(values, ",") + "\n", nil + } + return "VALUES: \n", err } // appendListValue returns if the given value was successfuly added to the List (true) or not (false) @@ -817,8 +831,9 @@ func appendListValue(s *sdk.SDK, listName string, value string) (string, error) ok, err := s.Alpha().AppendListValue(listName, value) if err != nil { log.Printf("Error appending Value %s to List %s: %s", value, listName, err) + return strconv.FormatBool(ok), err } - return strconv.FormatBool(ok), err + return "SUCCESS: " + strconv.FormatBool(ok) + "\n", nil } // deleteListValue returns if the given value was successfuly deleted from the List (true) or not (false) @@ -827,8 +842,9 @@ func deleteListValue(s *sdk.SDK, listName string, value string) (string, error) ok, err := s.Alpha().DeleteListValue(listName, value) if err != nil { log.Printf("Error deleting Value %s to List %s: %s", value, listName, err) + return strconv.FormatBool(ok), err } - return strconv.FormatBool(ok), err + return "SUCCESS: " + strconv.FormatBool(ok) + "\n", nil } // doHealth sends the regular Health Pings diff --git a/install/helm/agones/templates/tests/test-runner.yaml b/install/helm/agones/templates/tests/test-runner.yaml index 01932acba7..ab75858400 100644 --- a/install/helm/agones/templates/tests/test-runner.yaml +++ b/install/helm/agones/templates/tests/test-runner.yaml @@ -29,7 +29,7 @@ spec: imagePullPolicy: Always env: - name: GAMESERVER_IMAGE - value: "us-docker.pkg.dev/agones-images/examples/simple-game-server:0.25" + value: "us-docker.pkg.dev/agones-images/examples/simple-game-server:0.27" - name: IS_HELM_TEST value: "true" - name: GAMESERVERS_NAMESPACE diff --git a/pkg/util/webhooks/webhooks_test.go b/pkg/util/webhooks/webhooks_test.go index cbc2107bce..09a2853622 100644 --- a/pkg/util/webhooks/webhooks_test.go +++ b/pkg/util/webhooks/webhooks_test.go @@ -164,7 +164,7 @@ func TestWebHookFleetValidationHandler(t *testing.T) { "template": { "spec": { "containers": [{ - "image": "us-docker.pkg.dev/agones-images/examples/simple-game-server:0.25", + "image": "us-docker.pkg.dev/agones-images/examples/simple-game-server:0.27", "name": false }] } diff --git a/site/config.toml b/site/config.toml index e26ad838b8..fdd0217cfa 100644 --- a/site/config.toml +++ b/site/config.toml @@ -100,7 +100,7 @@ dev_eks_example_cluster_version = "1.28" dev_minikube_example_cluster_version = "1.27.6" # example tag -example_image_tag = "us-docker.pkg.dev/agones-images/examples/simple-game-server:0.25" +example_image_tag = "us-docker.pkg.dev/agones-images/examples/simple-game-server:0.27" # Enable syntax highlighting and copy buttons on code blocks with Prism prism_syntax_highlighting = true diff --git a/site/content/en/docs/Guides/fleet-updates.md b/site/content/en/docs/Guides/fleet-updates.md index f32b8982fc..de4efb973c 100644 --- a/site/content/en/docs/Guides/fleet-updates.md +++ b/site/content/en/docs/Guides/fleet-updates.md @@ -175,7 +175,7 @@ spec: spec: containers: - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.25 + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.27 ``` See the [Fleet reference]({{% relref "../Reference/fleet.md" %}}) for more details. diff --git a/test/e2e/fleet_test.go b/test/e2e/fleet_test.go index 5c8742742e..02dc258e1e 100644 --- a/test/e2e/fleet_test.go +++ b/test/e2e/fleet_test.go @@ -1659,13 +1659,13 @@ func TestFleetAggregatedCounterStatus(t *testing.T) { msg := fmt.Sprintf("SET_COUNTER_CAPACITY games %d", capacity) reply, err := framework.SendGameServerUDP(t, &gs, msg) require.NoError(t, err) - assert.Equal(t, "true", reply) + assert.Equal(t, "SUCCESS: true\n", reply) totalCount += count msg = fmt.Sprintf("SET_COUNTER_COUNT games %d", count) reply, err = framework.SendGameServerUDP(t, &gs, msg) require.NoError(t, err) - assert.Equal(t, "true", reply) + assert.Equal(t, "SUCCESS: true\n", reply) if gs.Status.State == agonesv1.GameServerStateAllocated { allocatedCapacity += capacity @@ -1742,7 +1742,7 @@ func TestFleetAggregatedListStatus(t *testing.T) { msg := fmt.Sprintf("SET_LIST_CAPACITY gamers %d", capacity) reply, err := framework.SendGameServerUDP(t, &gs, msg) require.NoError(t, err) - assert.Equal(t, "true", reply) + assert.Equal(t, "SUCCESS: true\n", reply) totalCount += count // Each list starts with a count of 2 (Values: []string{"gamer0", "gamer1"}) @@ -1750,7 +1750,7 @@ func TestFleetAggregatedListStatus(t *testing.T) { msg = fmt.Sprintf("APPEND_LIST_VALUE gamers gamer%d", i) reply, err = framework.SendGameServerUDP(t, &gs, msg) require.NoError(t, err) - assert.Equal(t, "true", reply) + assert.Equal(t, "SUCCESS: true\n", reply) } if gs.Status.State == agonesv1.GameServerStateAllocated { diff --git a/test/e2e/framework/framework.go b/test/e2e/framework/framework.go index 0c7922ff7a..3abaf3fe42 100644 --- a/test/e2e/framework/framework.go +++ b/test/e2e/framework/framework.go @@ -150,7 +150,7 @@ func NewFromFlags() (*Framework, error) { } viper.SetDefault(kubeconfigFlag, filepath.Join(usr.HomeDir, ".kube", "config")) - viper.SetDefault(gsimageFlag, "us-docker.pkg.dev/agones-images/examples/simple-game-server:0.25") + viper.SetDefault(gsimageFlag, "us-docker.pkg.dev/agones-images/examples/simple-game-server:0.27") viper.SetDefault(pullSecretFlag, "") viper.SetDefault(stressTestLevelFlag, 0) viper.SetDefault(perfOutputDirFlag, "") diff --git a/test/e2e/gameserver_test.go b/test/e2e/gameserver_test.go index 551f4466c1..6ea76105ae 100644 --- a/test/e2e/gameserver_test.go +++ b/test/e2e/gameserver_test.go @@ -1100,7 +1100,7 @@ spec: preferredDuringSchedulingIgnoredDuringExecution: ERROR containers: - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.25 + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.27 ` err := os.WriteFile("/tmp/invalid.yaml", []byte(gsYaml), 0o644) require.NoError(t, err) @@ -1365,7 +1365,7 @@ func TestCounters(t *testing.T) { }{ "GetCounterCount": { msg: "GET_COUNTER_COUNT games", - want: "1", + want: "COUNTER: 1\n", }, "GetCounterCount Counter Does Not Exist": { msg: "GET_COUNTER_COUNT fame", @@ -1373,21 +1373,21 @@ func TestCounters(t *testing.T) { }, "IncrementCounter": { msg: "INCREMENT_COUNTER foo 10", - want: "true", + want: "SUCCESS: true\n", counterName: "foo", - wantCount: "20", + wantCount: "COUNTER: 20\n", }, "IncrementCounter Past Capacity": { msg: "INCREMENT_COUNTER games 50", want: "ERROR: false\n", counterName: "games", - wantCount: "1", + wantCount: "COUNTER: 1\n", }, "IncrementCounter Negative": { msg: "INCREMENT_COUNTER games -1", want: "ERROR: false\n", counterName: "games", - wantCount: "1", + wantCount: "COUNTER: 1\n", }, "IncrementCounter Counter Does Not Exist": { msg: "INCREMENT_COUNTER same 1", @@ -1395,21 +1395,21 @@ func TestCounters(t *testing.T) { }, "DecrementCounter": { msg: "DECREMENT_COUNTER bar 10", - want: "true", + want: "SUCCESS: true\n", counterName: "bar", - wantCount: "0", + wantCount: "COUNTER: 0\n", }, "DecrementCounter Past Capacity": { msg: "DECREMENT_COUNTER games 2", want: "ERROR: false\n", counterName: "games", - wantCount: "1", + wantCount: "COUNTER: 1\n", }, "DecrementCounter Negative": { msg: "DECREMENT_COUNTER games -1", want: "ERROR: false\n", counterName: "games", - wantCount: "1", + wantCount: "COUNTER: 1\n", }, "DecrementCounter Counter Does Not Exist": { msg: "DECREMENT_COUNTER lame 1", @@ -1417,25 +1417,25 @@ func TestCounters(t *testing.T) { }, "SetCounterCount": { msg: "SET_COUNTER_COUNT baz 0", - want: "true", + want: "SUCCESS: true\n", counterName: "baz", - wantCount: "0", + wantCount: "COUNTER: 0\n", }, "SetCounterCount Past Capacity": { msg: "SET_COUNTER_COUNT games 51", want: "ERROR: false\n", counterName: "games", - wantCount: "1", + wantCount: "COUNTER: 1\n", }, "SetCounterCount Past Zero": { msg: "SET_COUNTER_COUNT games -1", want: "ERROR: false\n", counterName: "games", - wantCount: "1", + wantCount: "COUNTER: 1\n", }, "GetCounterCapacity": { msg: "GET_COUNTER_CAPACITY games", - want: "50", + want: "CAPACITY: 50\n", }, "GetCounterCapacity Counter Does Not Exist": { msg: "GET_COUNTER_CAPACITY dame", @@ -1443,15 +1443,15 @@ func TestCounters(t *testing.T) { }, "SetCounterCapacity": { msg: "SET_COUNTER_CAPACITY qux 0", - want: "true", + want: "SUCCESS: true\n", counterName: "qux", - wantCapacity: "0", + wantCapacity: "CAPACITY: 0\n", }, "SetCounterCapacity Past Zero": { msg: "SET_COUNTER_CAPACITY games -42", want: "ERROR: false\n", counterName: "games", - wantCount: "1", + wantCount: "COUNTER: 1\n", }, } // nolint:dupl // Linter errors on lines are duplicate of TestLists @@ -1525,69 +1525,69 @@ func TestLists(t *testing.T) { }{ "GetListCapacity": { msg: "GET_LIST_CAPACITY games", - want: "50", + want: "CAPACITY: 50\n", }, "SetListCapacity": { msg: "SET_LIST_CAPACITY foo 1000", - want: "true", + want: "SUCCESS: true\n", listName: "foo", - wantCapacity: "1000", + wantCapacity: "CAPACITY: 1000\n", }, "SetListCapacity past 1000": { msg: "SET_LIST_CAPACITY games 1001", want: "ERROR: false\n", listName: "games", - wantCapacity: "50", + wantCapacity: "CAPACITY: 50\n", }, "SetListCapacity negative": { msg: "SET_LIST_CAPACITY games -1", want: "ERROR: false\n", listName: "games", - wantCapacity: "50", + wantCapacity: "CAPACITY: 50\n", }, "ListContains": { msg: "LIST_CONTAINS games game2", - want: "true", + want: "FOUND: true\n", }, "ListContains false": { msg: "LIST_CONTAINS games game0", - want: "false", + want: "FOUND: false\n", }, "GetListLength": { msg: "GET_LIST_LENGTH games", - want: "2", + want: "LENGTH: 2\n", }, "GetListValues": { msg: "GET_LIST_VALUES games", - want: "game1,game2\n", + want: "VALUES: game1,game2\n", }, "GetListValues empty": { msg: "GET_LIST_VALUES foo", - want: "\n", + want: "VALUES: \n", }, "AppendListValue": { msg: "APPEND_LIST_VALUE bar bar3", - want: "true", + want: "SUCCESS: true\n", listName: "bar", - wantLength: "3", + wantLength: "LENGTH: 3\n", }, "AppendListValue past capacity": { msg: "APPEND_LIST_VALUE baz baz2", want: "ERROR: false\n", listName: "baz", - wantLength: "1", + wantLength: "LENGTH: 1\n", }, "DeleteListValue": { msg: "DELETE_LIST_VALUE qux qux3", - want: "true", + want: "SUCCESS: true\n", listName: "qux", - wantLength: "3", + wantLength: "LENGTH: 3\n", }, "DeleteListValue value does not exist": { msg: "DELETE_LIST_VALUE games game4", want: "ERROR: false\n", listName: "games", - wantLength: "2", + wantLength: "LENGTH: 2\n", }, } // nolint:dupl // Linter errors on lines are duplicate of TestCounters diff --git a/test/load/allocation/fleet.yaml b/test/load/allocation/fleet.yaml index 426151a890..a9361af97d 100644 --- a/test/load/allocation/fleet.yaml +++ b/test/load/allocation/fleet.yaml @@ -33,7 +33,7 @@ spec: spec: containers: - args: [-automaticShutdownDelaySec=600] - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.25 + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.27 name: simple-game-server resources: limits: diff --git a/test/load/allocation/performance-test-fleet-template.yaml b/test/load/allocation/performance-test-fleet-template.yaml index 9dfbaf9134..5ec308214f 100644 --- a/test/load/allocation/performance-test-fleet-template.yaml +++ b/test/load/allocation/performance-test-fleet-template.yaml @@ -33,7 +33,7 @@ spec: spec: containers: - args: [-automaticShutdownDelaySec=AUTOMATIC_SHUTDOWN_DELAY_SEC_REPLACEMENT] - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.25 + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.27 name: simple-game-server resources: limits: diff --git a/test/load/allocation/scenario-fleet.yaml b/test/load/allocation/scenario-fleet.yaml index b54b9b53cf..2d72fd1ae3 100644 --- a/test/load/allocation/scenario-fleet.yaml +++ b/test/load/allocation/scenario-fleet.yaml @@ -38,7 +38,7 @@ spec: value: 'true' containers: - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.25 + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.27 args: [-automaticShutdownDelaySec=60, -readyIterations=10] resources: limits: