Skip to content

Commit

Permalink
Local SDK: Refactor List and Count keys for default GameServer (#3598)
Browse files Browse the repository at this point in the history
* Local SDK: Refactor List and Count keys for default GameServer

* modify sdk-client-test.go
  • Loading branch information
Kalaiselvi84 authored Jan 22, 2024
1 parent e52f20a commit eb4035e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pkg/sdkserver/localsdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ func NewLocalSDKServer(filePath string, testSdkName string) (*LocalSDKServer, er
// Adding test Counter and List for the conformance tests (not nil for LocalSDKServer tests)
if l.gs.Status.Counters == nil {
l.gs.Status.Counters = map[string]*sdk.GameServer_Status_CounterStatus{
"conformanceTestCounter": {Count: 1, Capacity: 10}}
"rooms": {Count: 1, Capacity: 10}}
}
if l.gs.Status.Lists == nil {
l.gs.Status.Lists = map[string]*sdk.GameServer_Status_ListStatus{
"conformanceTestList": {Values: []string{"test0", "test1", "test2"}, Capacity: 100}}
"players": {Values: []string{"test0", "test1", "test2"}, Capacity: 100}}
}
}

Expand Down
8 changes: 4 additions & 4 deletions test/sdk/go/sdk-client-test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ func testPlayerTracking(sdk *goSdk.SDK) {
}

func testCounts(sdk *goSdk.SDK) {
// LocalSDKServer starting "conformanceTestCounter": {Count: 1, Capacity: 10}
counter := "conformanceTestCounter"
// LocalSDKServer starting "rooms": {Count: 1, Capacity: 10}
counter := "rooms"
count, err := sdk.Alpha().GetCounterCount(counter)
if err != nil {
log.Fatalf("Error getting Counter count: %s", err)
Expand Down Expand Up @@ -195,8 +195,8 @@ func testCounts(sdk *goSdk.SDK) {
}

func testLists(sdk *goSdk.SDK) {
// LocalSDKServer starting "conformanceTestList": {Values: []string{"test0", "test1", "test2"}, Capacity: 100}}
list := "conformanceTestList"
// LocalSDKServer starting "players": {Values: []string{"test0", "test1", "test2"}, Capacity: 100}}
list := "players"
vals := []string{"test0", "test1", "test2"}

contains, err := sdk.Alpha().ListContains(list, "test1")
Expand Down
4 changes: 2 additions & 2 deletions test/sdk/restapi/http-api-test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func testPlayers(ctx context.Context, alphaCli *alpha.APIClient) {

func testCounters(ctx context.Context, alphaCli *alpha.APIClient) {
// Tests are expected to run sequentially on the same pre-defined Counter in the localsdk server
counterName := "conformanceTestCounter"
counterName := "rooms"

expectedCounter := alpha.AlphaCounter{Name: counterName, Count: "1", Capacity: "10"}
if counter, _, err := alphaCli.SDKApi.GetCounter(ctx, counterName); err != nil {
Expand Down Expand Up @@ -216,7 +216,7 @@ func testCounters(ctx context.Context, alphaCli *alpha.APIClient) {

func testLists(ctx context.Context, alphaCli *alpha.APIClient) {
// Tests are expected to run sequentially on the same pre-defined List in the localsdk server
listName := "conformanceTestList"
listName := "players"

expectedList := alpha.AlphaList{Name: listName, Values: []string{"test0", "test1", "test2"}, Capacity: "100"}
if list, _, err := alphaCli.SDKApi.GetList(ctx, listName); err != nil {
Expand Down

0 comments on commit eb4035e

Please sign in to comment.