Skip to content

e2e: add webhook autoscaler test with fleet metadata #4251

Merged
0xaravindh merged 6 commits intoagones-dev:mainfrom
0xaravindh:e2e-test
Sep 1, 2025
Merged

e2e: add webhook autoscaler test with fleet metadata #4251
0xaravindh merged 6 commits intoagones-dev:mainfrom
0xaravindh:e2e-test

Conversation

@0xaravindh
Copy link
Copy Markdown

What type of PR is this?

/kind cleanup

What this PR does / Why we need it:

  • Implemented an end-to-end test for the webhook autoscaler that validates
    fleet metadata is passed through correctly.
  • Updated defaultAutoscalerWebhook to accept a parameter for FIXED_REPLICAS,
    enabling tests to toggle override behavior as needed.
  • Ensures fleet replicas scale to the expected fixed value when metadata
    annotations are applied.

Which issue(s) this PR fixes:

Closes #4117

Special notes for your reviewer:

I haven’t generated the example/autoscaler-webhook image for version v0.19 yet. Because of this, the test case will currently fail. Once the PR is reviewed, I will create the image.

- Implemented an end-to-end test for the webhook autoscaler that validates
  fleet metadata is passed through correctly.
- Updated defaultAutoscalerWebhook to accept a parameter for FIXED_REPLICAS,
  enabling tests to toggle override behavior as needed.
- Ensures fleet replicas scale to the expected fixed value when metadata
  annotations are applied.

Fixes agones-dev#4117
@0xaravindh 0xaravindh self-assigned this Aug 18, 2025
@github-actions github-actions bot added kind/cleanup Refactoring code, fixing up documentation, etc size/M labels Aug 18, 2025
Copy link
Copy Markdown
Collaborator

@markmandel markmandel left a comment

Choose a reason for hiding this comment

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

A minor nit, but otherwise looks good.

🤔 wondering if we want to test labels? We could do the same test for annotation we do for a label? (basically just make the webhook look to see if there is a label OR annotation, and react appropriately?)

Only other idea I have.

t.Parallel()

ctx := context.Background()
fmt.Println("framework.Namespace", framework.Namespace)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I removed the unnecessary logs.

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Failed 😭

Build Id: 940b9446-d16e-450e-8504-bb539ded63bb

Status: FAILURE

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

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Failed 😭

Build Id: a638039e-eb54-40ab-be13-62bb6246bb41

Status: FAILURE

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

Copy link
Copy Markdown
Collaborator

@vicentefb vicentefb left a comment

Choose a reason for hiding this comment

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

lgtm

@0xaravindh
Copy link
Copy Markdown
Author

@vicentefb The example/autoscaler-webhook image for version v0.19 has been created

image

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Failed 😭

Build Id: e5dc2ad3-7aef-431e-966d-906c60933546

Status: FAILURE

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

@0xaravindh
Copy link
Copy Markdown
Author

/gcbrun

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Failed 😭

Build Id: 1fd008eb-3ad5-44f1-b6dd-2005c49852ad

Status: FAILURE

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

@0xaravindh
Copy link
Copy Markdown
Author

/gcbrun

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Failed 😭

Build Id: ef4c4dd5-1194-440b-b863-c6dd3ceb019b

Status: TIMEOUT

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

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Failed 😭

Build Id: aaa49b96-6cea-4b95-9ba7-91a8049a807a

Status: FAILURE

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

@0xaravindh
Copy link
Copy Markdown
Author

/gcbrun

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Failed 😭

Build Id: 3499cc47-8c94-40a7-8cb8-4f52608816aa

Status: FAILURE

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

@0xaravindh
Copy link
Copy Markdown
Author

/gcbrun

@agones-bot
Copy link
Copy Markdown
Collaborator

Build Succeeded 🥳

Build Id: 1f582213-d94b-49a3-b2b8-b3e70a56c2a0

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/googleforgames/agones.git pull/4251/head:pr_4251 && git checkout pr_4251
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.52.0-dev-208311d

@0xaravindh 0xaravindh merged commit ed4e319 into agones-dev:main Sep 1, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Refactoring code, fixing up documentation, etc size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

end to end test: Webhook autoscaler to with fleet metadata

4 participants