Skip to content

feat(conformance): Add HTTPRoute port validation tests for InferencePool backends #911

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 9 commits into
base: main
Choose a base branch
from

Conversation

zetxqx
Copy link
Contributor

@zetxqx zetxqx commented Jun 2, 2025

Adds new conformance tests (InferencePoolHTTPRoutePortValidation) to verify HTTPRoute.spec.rules.backendRefs.port behavior with InferencePool backends. Covers scenarios for unspecified, matching, and non-matching ports.

This PR is originally from #887 to address #886. Based on the discussion #918 , now the test is updated to

  1. HTTPRoute.BackendRef.Port unspecified, gateway can send traffic successfully.
  2. HTTPRoute.BackendRef.Port is set and equals to InferencePool.TargetPortNumber, gateway can send traffic successfully.
  3. HTTPRoute.BackendRef.Port is set and not equal to InferencePool.TargetPortNumber, gateway can still send traffic successfully.

One missing part is for case3, we need to verify there is warning in httpRoute mentioned in Option5 from #918

Testing against istio:

go test -v ./conformance -args -debug -gateway-class istio -cleanup-base-resources=false -run-test InferencePoolHTTPRoutePortValidation

=== RUN   TestConformance
...
--- PASS: TestConformance (16.07s)
    --- SKIP: TestConformance/HTTPRouteInvalidInferencePoolRef (0.00s)
    --- SKIP: TestConformance/InferencePoolAccepted (0.00s)
    --- PASS: TestConformance/InferencePoolHTTPRoutePortValidation (13.05s)
        --- PASS: TestConformance/InferencePoolHTTPRoutePortValidation/Scenario_1:_HTTPRoute_backendRef_to_InferencePool_with_Port_Unspecified (10.41s)
        --- PASS: TestConformance/InferencePoolHTTPRoutePortValidation/Scenario_2:_HTTPRoute_backendRef_to_InferencePool_with_Port_Specified_and_Matching (0.10s)
        --- PASS: TestConformance/InferencePoolHTTPRoutePortValidation/Scenario_3:_HTTPRoute_backendRef_to_InferencePool_with_Port_Specified_and_Non-Matching._Request_still_passing_because_HTTP_Port_is_ignored_when_inferencePool_is_backendRef (0.34s)
    --- SKIP: TestConformance/InferencePoolResolvedRefsCondition (0.00s)

Testing against gke-l7-regional-external-managed

go test -v ./conformance -args -debug -gateway-class gke-l7-regional-external-managed -cleanup-base-resources=false -run-test InferencePoolHTTPRoutePortValidation

=== RUN   TestConformance/InferencePoolResolvedRefsCondition
    conformance.go:68: Skipping InferencePoolResolvedRefsCondition: test explicitly skipped
--- PASS: TestConformance (280.47s)
    --- SKIP: TestConformance/HTTPRouteInvalidInferencePoolRef (0.00s)
    --- SKIP: TestConformance/InferencePoolAccepted (0.00s)
    --- PASS: TestConformance/InferencePoolHTTPRoutePortValidation (276.86s)
        --- PASS: TestConformance/InferencePoolHTTPRoutePortValidation/Scenario_1:_HTTPRoute_backendRef_to_InferencePool_with_Port_Unspecified (274.23s)
        --- PASS: TestConformance/InferencePoolHTTPRoutePortValidation/Scenario_2:_HTTPRoute_backendRef_to_InferencePool_with_Port_Specified_and_Matching (0.11s)
        --- PASS: TestConformance/InferencePoolHTTPRoutePortValidation/Scenario_3:_HTTPRoute_backendRef_to_InferencePool_with_Port_Specified_and_Non-Matching._Request_still_passing_because_HTTP_Port_is_ignored_when_inferencePool_is_backendRef (0.10s)
    --- SKIP: TestConformance/InferencePoolResolvedRefsCondition (0.00s)

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 2, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: zetxqx
Once this PR has been reviewed and has the lgtm label, please assign danehans 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

@k8s-ci-robot
Copy link
Contributor

Welcome @zetxqx!

It looks like this is your first PR to kubernetes-sigs/gateway-api-inference-extension 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/gateway-api-inference-extension has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 2, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @zetxqx. 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 requested review from kfswain and robscott June 2, 2025 22:03
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 2, 2025
Copy link

netlify bot commented Jun 2, 2025

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

Name Link
🔨 Latest commit 0eb6a29
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/6849d7312a29c5000801c65e
😎 Deploy Preview https://deploy-preview-911--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.

@ahg-g
Copy link
Contributor

ahg-g commented Jun 5, 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 Jun 5, 2025
@zetxqx zetxqx changed the title [WIP] feat(conformance): Add HTTPRoute port validation tests for InferencePool backends feat(conformance): Add HTTPRoute port validation tests for InferencePool backends Jun 11, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 11, 2025
@zetxqx
Copy link
Contributor Author

zetxqx commented Jun 11, 2025

@robscott This is also ready for review. Thanks in advance!

type: PathPrefix
value: /test-port-non-matching
---
# --- Conformance EPP Requried Role and RoleBindings ---
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These will be refactored to a common place. But for this PR itself, I would like to keep it as is for making the focus of this PR clear.

@zetxqx zetxqx mentioned this pull request Jun 12, 2025
12 tasks
@nirrozenbaum
Copy link
Contributor

/test pull-gateway-api-inference-extension-test-e2e-main

@danehans
Copy link
Contributor

One missing part is for case3, we need to verify there is warning in httpRoute mentioned in Option5 from #918

This warning message will need to be defined in Gateway API, so the standard message can be asserted in conformance tests. @robscott should we proceed with option 3 from the discussion until the message is standardized in v1.4 of Gateway API?

@robscott
Copy link
Member

This warning message will need to be defined in Gateway API, so the standard message can be asserted in conformance tests. @robscott should we proceed with option 3 from the discussion until the message is standardized in v1.4 of Gateway API?

IMO, "Gateway implementations put a warning on HTTPRoute status when HTTPRoute.BackendRef.Port is set and an InferencePool is targeted, saying that the port will be ignored" from option 5 is something that works now and in the future. After Gateway v1.4 is released, we won't be able to test this because Gateway API CRDs will prevent this from being possible, so maybe we should leave it out of conformance tests altogether.

@zetxqx
Copy link
Contributor Author

zetxqx commented Jun 17, 2025

@robscott I agree with "we should leave it out of conformance tests altogether". The current PR doesn't have that check. So is it good to get a LG?

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.

7 participants