Skip to content

feat(conformance): Add HTTPRouteMultipleGatewaysDifferentPools test #838

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

SinaChavoshi
Copy link
Contributor

This PR introduces a new conformance test, HTTPRouteMultipleGatewaysDifferentPools, which validates a scenario where two distinct HTTPRoute resources, parented by different Gateway resources, successfully reference and route traffic to separate InferencePool backends.

local run results: ( Ran on commit fe540a7)

go test -v ./conformance -args -debug     -gateway-class gke-l7-regional-external-managed     -cleanup-base-resources=false     -run-test HTTPRouteMultipleGatewaysDifferentPools
=== RUN   TestConformance
    conformance.go:197: Registering API types with scheme...
...
--- PASS: TestConformance (42.70s)
    --- PASS: TestConformance/HTTPRouteMultipleGatewaysDifferentPools (39.18s)
        --- PASS: TestConformance/HTTPRouteMultipleGatewaysDifferentPools/HTTPRoute_for_Gateway_1_should_be_Accepted_and_Reconciled (21.20s)
        --- PASS: TestConformance/HTTPRouteMultipleGatewaysDifferentPools/InferencePool_A_(pool-a)_should_be_Accepted (0.08s)
        --- PASS: TestConformance/HTTPRouteMultipleGatewaysDifferentPools/HTTPRoute_for_Gateway_2_should_be_Accepted_and_Reconciled (15.12s)
        --- PASS: TestConformance/HTTPRouteMultipleGatewaysDifferentPools/InferencePool_B_(pool-b)_should_be_Accepted (0.06s)
    --- SKIP: TestConformance/InferencePoolAccepted (0.00s)
PASS
ok 

Copy link

netlify bot commented May 15, 2025

Deploy Preview for gateway-api-inference-extension ready!

Name Link
🔨 Latest commit 68812d7
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/682cf303935d3e0009fe4ecb
😎 Deploy Preview https://deploy-preview-838--gateway-api-inference-extension.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 15, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @SinaChavoshi. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 15, 2025
@spencerhance
Copy link

/cc

@k8s-ci-robot k8s-ci-robot requested a review from spencerhance May 16, 2025 18:16
Copy link

@spencerhance spencerhance left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 16, 2025
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 19, 2025
@spencerhance
Copy link

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 19, 2025
@ahg-g
Copy link
Contributor

ahg-g commented May 20, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 20, 2025
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 20, 2025
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

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

Thanks @SinaChavoshi! A couple tiny nits, otherwise LGTM.

from: All
kinds:
- group: gateway.networking.k8s.io
kind: HTTPRoute
Copy link
Member

Choose a reason for hiding this comment

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

Don't forget trailing new lines in these files

matches:
- path:
type: PathPrefix
value: /test-gw2
Copy link
Member

Choose a reason for hiding this comment

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

Same comment here

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: robscott, SinaChavoshi, spencerhance
Once this PR has been reviewed and has the lgtm label, please assign jeffwan for approval. For more information see the Code Review Process.

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

Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

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

Sorry, just adding a couple tiny nits as I've been thinking more broadly about how this will fit in with the rest of the conformance tests.

t.Logf("HTTPRoute %s has all references resolved by Gateway %s", routeForGW2NN.String(), gateway2NN.String())
})

t.Run("InferencePool B (pool-b) should be Accepted", func(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

On further thought, I'd expect these tests to go further. To really ensure that this is working as expected, we should try to send a request and ensure it gets routed to the appropriate InferencePool.


var timeoutConfig config.InferenceExtensionTimeoutConfig = config.DefaultInferenceExtensionTimeoutConfig()

t.Run("HTTPRoute for Gateway 1 should be Accepted and have ResolvedRefs", func(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

It feels like a lot of what's in this test is going to get repeated in almost every conformance test. I'd recommend having some helpers that turn the wait for an HTTPRoute and InferencePool to be accepted into single line function calls for each resource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants