-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Add e2e Tests for Proxy Annotations #3149
Conversation
85e1e2f
to
81434a1
Compare
/hold |
d820a63
to
d279415
Compare
@diazjf looks like most of these tests share the same logic, can you extract the logic into a helper function and reuse the function instead of duplication? |
func(server string) bool { | ||
return Expect(server).Should(ContainSubstring("proxy_read_timeout 20s;")) | ||
}) | ||
Expect(err).NotTo(HaveOccurred()) |
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.
Any reason why you aren't asserting all in the same place? i.e something like
err = f.WaitForNginxServer(host,
func(server string) bool {
return strings.Contains(server, "proxy_connect_timeout 50s;") && strings.Contains(server, "proxy_send_timeout 20s;") && strings.Contains(server, "proxy_read_timeout 20s;")
})
Expect(err).NotTo(HaveOccurred())
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.
I wanted to keep things consistent. Your suggestion makes more sense, it'll make the tests a little faster and its still readable. Thanks 💯
ba5690a
to
7fcd0b8
Compare
/hold remove |
/hold cancel |
}, | ||
}) | ||
Expect(err).NotTo(HaveOccurred()) | ||
Expect(ing).NotTo(BeNil()) |
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.
I think all these ingress creations with annotations can be extracted into a local helper function to avoid duplication:
somethine like:
func ensureIngress(f *framework.Framework, annotations: map[string]string) *extensions.Ingress
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.
Done, thanks. Will refactor and use this as a util function for other tests in another PR.
Adds e2e tests for the following annotations: - proxy-body-size - proxy-connect-timeout - proxy-send-timeout - proxy-read-timeout - proxy-buffering - proxy-buffer-size - proxy-request-buffering - proxy-next-upstream - proxy-next-upstream-tries - proxy-cookie-domain - proxy-cookie-path and also updates some documentation.
7fcd0b8
to
c981a65
Compare
Removes quotes from nginx directives which my cause issues with their functionality Fixes kubernetes#3152
@ElvinEfendi good suggestion. |
@ElvinEfendi @aledbf this one is good to go 👍 |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aledbf, diazjf The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@diazjf thanks! |
Adds e2e tests for the following annotations:
and also updates some documentation.
Fixes #3152