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

Player Tracking Go SDK Conformance Tests #1527

Merged

Conversation

markmandel
Copy link
Member

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking
/kind bug
/kind cleanup
/kind documentation

/kind feature

/kind hotfix

What this PR does / Why we need it:

Conformance tests for the Go SDK.

Which issue(s) this PR fixes:

Work on #1507

Special notes for your reviewer:

None.

@markmandel markmandel added kind/feature New features for Agones area/tests Unit tests, e2e tests, anything to make sure things don't break labels May 7, 2020
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: f251bdf4-d765-48ac-93a3-f7ef644a43a5

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 4d454845-45f7-4a56-8506-6e1ff85145bb

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1527/head:pr_1527 && git checkout pr_1527
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.6.0-da9cbe3

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 10da5f08-9019-4c9d-83fa-2bcaa2ca1fd0

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1527/head:pr_1527 && git checkout pr_1527
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.6.0-2989697

@@ -34,8 +34,7 @@ SDK_FOLDER ?= go
COMMAND ?= gen
SDK_IMAGE_TAG=$(build_sdk_prefix)$(SDK_FOLDER):$(build_sdk_version)
DEFAULT_CONFORMANCE_TESTS = ready,allocate,setlabel,setannotation,gameserver,health,shutdown,watch,reserve
ALPHA_CONFORMANCE_TESTS = getplayercapacity,setplayercapacity

ALPHA_CONFORMANCE_TESTS = getplayercapacity,setplayercapacity,playerconnect,playerdisconnect,getplayercount,isplayerconnected,getconnectedplayers
Copy link
Member

Choose a reason for hiding this comment

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

it looks like these don't have to be in the same order as the code. do we just check that they were all called?

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right, it doesn't matter the order they are called in - it checks that SDK methods are called with the expected arguments.

log.Fatalf("PlayerDisconnect returned false")
}

if c, err = sdk.Alpha().GetPlayerCount(); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

I don't know if it would work, but it would be nice to call this once with the player connected (and verify that result is 1) and then again here to check that it is back to 0.

Similarly, it would be nice to verify that IsPlayerConnected returns false for a non-existent player and also that it returns false for "1234" after the player disconnects.

I'm sure this is all covered by unit tests, but it would be nice to have it covered by the conformance tests as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is definitely covered by the unit tests, but I can't see how we could do this with the current structure of the conformance tests. The conformance tests check that a method has been called once with a specific value, so there is no concept for ordering.

@aLekSer unless you can think of anything I'm not thinking of?

Copy link
Member

Choose a reason for hiding this comment

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

That's what I thought. I don't want to block this change, but let's file an issue so we can discuss if it would be worth modifying the conformance test infra.

@roberthbailey
Copy link
Member

/assign

Conformance tests for the Go SDK.

Work on googleforgames#1507
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: bbd68abf-eadd-4945-b8fa-071b1bcdf9ea

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1527/head:pr_1527 && git checkout pr_1527
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.6.0-158607f

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: markmandel, roberthbailey

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [markmandel,roberthbailey]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@roberthbailey roberthbailey merged commit 141ef37 into googleforgames:master May 10, 2020
@markmandel markmandel deleted the feature/go-sdk-conformance branch May 10, 2020 12:43
@markmandel markmandel added this to the 1.6.0 milestone May 19, 2020
ilkercelikyilmaz pushed a commit to ilkercelikyilmaz/agones that referenced this pull request Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/tests Unit tests, e2e tests, anything to make sure things don't break kind/feature New features for Agones lgtm size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants