-
Notifications
You must be signed in to change notification settings - Fork 542
conformance: initial draft for CORS filter tests #3740
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
Conversation
Signed-off-by: Norwin Schnyder <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: snorwin 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 |
Hi @snorwin. 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 Once the patch is verified, the new status will be reflected by the 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. |
"Access-Control-Request-Method": "DELETE", | ||
}, | ||
}, | ||
ExpectedRequest: &http.ExpectedRequest{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't ExpectedRequest the request that hits the backend? Wouldn't this not hit the backend at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly. However ExpectedRequest: nil
implicitly sets the actual request as expected request, which isn't correct for this case.
Also. when I tried to set the expected request to be empty with ExpectedRequest: &http.ExpectedRequest{}
, it still didn't work. This is because the method of the captured request is set to the method of the actual request, even if there there is no captured request at all (https://github.com/kubernetes-sigs/gateway-api/blob/main/conformance/utils/roundtripper/roundtripper.go#L252).
If you have a more effective approach to assert that no request was sent to the backend, please let me know.
Closing in the favor of #3739. |
What type of PR is this?
/kind test
/area conformance-test
What this PR does / why we need it:
During the implementation of the new CORS HTTPRoute filter, I created additional tests that can serve as a foundation for developing conformance tests for the CORS feature (#1767).
The proposed tests focus on:
Origin
header setOpen Points
*
as an allowed origin (currently not possible due to CORS documentation and validation are not consistent #3648)Feedback is welcome to enhance the tests and address the open items effectively.
Does this PR introduce a user-facing change?: