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

Testing functions for resource events #208

Merged
merged 1 commit into from
May 18, 2018

Conversation

markmandel
Copy link
Member

I kept writing the same two select statements a lot, so I pulled it into the central testing library for reuse.

I kept writing the same two select statements
a lot, so I pulled it into the central testing
library for reuse.
@markmandel markmandel added kind/cleanup Refactoring code, fixing up documentation, etc area/build-tools Development tooling. I.e. pretty much everything in the `build` directory. labels May 18, 2018
@markmandel markmandel added this to the 0.2 milestone May 18, 2018
@markmandel markmandel requested a review from enocom May 18, 2018 00:59
select {
case e := <-events:
assert.Contains(t, e, contains)
case <-time.After(3 * time.Second):
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this duration be configurable?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've never had a need to change it. The event action is usually (always?) synchronous in testing, 3 seconds is really a "just in case" - it could probably be dropped lower.

Copy link
Contributor

@enocom enocom left a comment

Choose a reason for hiding this comment

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

Nice improvement. This sort of test helper is great to have and will be useful for future tests.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: efa3d9f8-1fd1-4ce6-8cda-6898c56f35b5

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

@markmandel markmandel merged commit b8d38ca into googleforgames:master May 18, 2018
@markmandel markmandel deleted the refactor/event-test branch May 18, 2018 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build-tools Development tooling. I.e. pretty much everything in the `build` directory. kind/cleanup Refactoring code, fixing up documentation, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants