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

Improved fleetautoscalers - fleetautoscalers_test.go unit tests + applyWebhookPolicy refactoring #1531

Merged
merged 9 commits into from
Jun 10, 2020

Conversation

akremsa
Copy link
Contributor

@akremsa akremsa commented May 8, 2020

What type of PR is this?

/kind cleanup

What this PR does / Why we need it:
Added missing unit tests to TestApplyWebhookPolicy and refactored applyWebhookPolicy method.
Added an absent error check after b, err := json.Marshal(faReq) which could be a potential bug.
Refactored TestComputeDesiredFleetSize and TestApplyBufferPolicy and added new test cases.

Special notes for your reviewer:
Before:
Screenshot 2020-05-08 at 16 47 18

After:
image

By the way, I suggest using url.ParseRequestURI instead of url.Parse.

if w.Service.Path != nil {
servicePath = *w.Service.Path

if w.URL != nil && w.Service != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 additional check would be great. Validated on Update but still something wrong could happen.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, taking into account the fact that another validation happens in a different package.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 844f2438-299c-4881-8cf7-16bba813a284

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

@akremsa akremsa force-pushed the fleetautoscalers_unit_tests branch from 0dd3cec to 3630834 Compare May 8, 2020 14:44
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 041001a9-ea5f-41a0-89f2-04673a1dcc88

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

@akremsa akremsa force-pushed the fleetautoscalers_unit_tests branch from 3630834 to 6183853 Compare May 8, 2020 23:00
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: d1007c0a-4537-45d5-b11c-3e9005b711b6

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

@akremsa akremsa force-pushed the fleetautoscalers_unit_tests branch from 6183853 to 5f60476 Compare May 8, 2020 23:45
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: b866e474-b138-4493-a79a-da7c67692885

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

@akremsa akremsa force-pushed the fleetautoscalers_unit_tests branch from 5f60476 to 3523987 Compare May 9, 2020 00:29
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: b9784537-393c-45f5-af58-b7834e9e9303

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/1531/head:pr_1531 && git checkout pr_1531
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.6.0-3523987

@akremsa akremsa force-pushed the fleetautoscalers_unit_tests branch from 3523987 to 5de2cf0 Compare May 11, 2020 09:34
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: f1e91a9b-7572-435d-a04b-438c68041fd7

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/1531/head:pr_1531 && git checkout pr_1531
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.6.0-5de2cf0

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 725f0237-7f6e-4331-9ef7-d179b107072b

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/1531/head:pr_1531 && git checkout pr_1531
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.6.0-465adf4

@akremsa akremsa changed the title Improved fleetautoscalers - TestApplyWebhookPolicy unit tests + applyWebhookPolicy refactoring Improved fleetautoscalers - fleetautoscalers_test.go unit tests + applyWebhookPolicy refactoring May 11, 2020
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: d20a5fcf-347f-4932-b59a-8c8c3261498b

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

@akremsa akremsa force-pushed the fleetautoscalers_unit_tests branch from 1378040 to f2cb6bd Compare May 11, 2020 13:04
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 9f99225f-13e1-4c00-911a-5b42b55e5212

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

@akremsa akremsa force-pushed the fleetautoscalers_unit_tests branch from f2cb6bd to 6239f90 Compare May 12, 2020 15:03
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: cf961221-8a4f-4eb8-8b9a-5de92468c5a5

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

@akremsa akremsa force-pushed the fleetautoscalers_unit_tests branch from 6239f90 to d9ee2ba Compare May 14, 2020 11:58
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: fa3521c7-7519-41c1-96d8-c2fc73fec90c

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

@akremsa akremsa force-pushed the fleetautoscalers_unit_tests branch from d9ee2ba to c303f1c Compare May 15, 2020 12:33
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 851235fe-2a39-4b35-bfb7-d83a8019dd72

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

Copy link
Collaborator

@aLekSer aLekSer left a comment

Choose a reason for hiding this comment

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

@akremsa Alexey, please add nil check to service and this PR is good to go. I will double check that nothing is broken, if we follow the guide here :
https://agones.dev/site/docs/getting-started/create-fleetautoscaler/

@akremsa akremsa force-pushed the fleetautoscalers_unit_tests branch from fa6e359 to 139140e Compare June 8, 2020 22:45
@akremsa
Copy link
Contributor Author

akremsa commented Jun 8, 2020

@aLekSer done

@akremsa akremsa requested a review from aLekSer June 8, 2020 22:46
@akremsa akremsa force-pushed the fleetautoscalers_unit_tests branch from 139140e to 3fcde1f Compare June 9, 2020 11:32
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 2224389a-34f6-4b46-8ef8-f533eceac619

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/1531/head:pr_1531 && git checkout pr_1531
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.7.0-3fcde1f

Copy link
Collaborator

@aLekSer aLekSer left a comment

Choose a reason for hiding this comment

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

Thanks for this changes.

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: akremsa, aLekSer
To complete the pull request process, please assign markmandel
You can assign the PR to them by writing /assign @markmandel in a comment when ready.

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

Needs approval from an approver in each of these files:

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

@pooneh-m pooneh-m merged commit 48013e6 into googleforgames:master Jun 10, 2020
@markmandel markmandel added this to the 1.7.0 milestone Jun 30, 2020
@markmandel markmandel added area/tests Unit tests, e2e tests, anything to make sure things don't break kind/cleanup Refactoring code, fixing up documentation, etc labels Jun 30, 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
area/tests Unit tests, e2e tests, anything to make sure things don't break kind/cleanup Refactoring code, fixing up documentation, etc lgtm size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants