Skip to content
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

Improve e2e tests checking if backends are properly working #7407

Closed
4 tasks
rikatz opened this issue Jul 29, 2021 · 12 comments · Fixed by #7415 or #7463
Closed
4 tasks

Improve e2e tests checking if backends are properly working #7407

rikatz opened this issue Jul 29, 2021 · 12 comments · Fixed by #7415 or #7463
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@rikatz
Copy link
Contributor

rikatz commented Jul 29, 2021

Some e2e tests checks if the nginx generated template contains the expected string, but does not properly tests if it's really working.

Some examples:

As a good practice, we should verify not only if the template was generated correctly, but if it is working as desired.

A good example is available in

f.HTTPTestClient().
GET("/").
WithHeader("Host", host).
Expect().
Status(http.StatusOK)

to see if this is working as desired.

/good-first-issue
/area test
/triage accepted
/priority backlog
/kind cleanup

@k8s-ci-robot
Copy link
Contributor

@rikatz:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

Some e2e tests checks if the nginx generated template contains the expected string, but does not properly tests if it's really working.

For example:

https://github.com/kubernetes/ingress-nginx/blob/main/test/e2e/annotations/backendprotocol.go

As a good practice, we should verify not only if the template was generated correctly, but if it is working as desired.

A good example is available in

f.HTTPTestClient().
GET("/").
WithHeader("Host", host).
Expect().
Status(http.StatusNotFound)

We should always test with:

  f.HTTPTestClient().
  		GET("/").
  		WithHeader("Host", host).
  		Expect().
  		Status(http.StatusOK)

to see if this is working as desired.

/good-first-issue
/area test
/triage accepted
/priority backlog
/kind cleanup

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/backlog Higher priority than priority/awaiting-more-evidence. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels Jul 29, 2021
@k8s-ci-robot
Copy link
Contributor

@rikatz: The label(s) area/test cannot be applied, because the repository doesn't have them.

In response to this:

Some e2e tests checks if the nginx generated template contains the expected string, but does not properly tests if it's really working.

For example:

https://github.com/kubernetes/ingress-nginx/blob/main/test/e2e/annotations/backendprotocol.go

As a good practice, we should verify not only if the template was generated correctly, but if it is working as desired.

A good example is available in

f.HTTPTestClient().
GET("/").
WithHeader("Host", host).
Expect().
Status(http.StatusNotFound)

We should always test with:

  f.HTTPTestClient().
  		GET("/").
  		WithHeader("Host", host).
  		Expect().
  		Status(http.StatusOK)

to see if this is working as desired.

/good-first-issue
/area test
/triage accepted
/priority backlog
/kind cleanup

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Jul 29, 2021
@rikatz
Copy link
Contributor Author

rikatz commented Jul 29, 2021

Please leave this issue for first time contributors :)

Also, the above is an example, we need to check what tests lacks some backend testing and add into them

@rikatz
Copy link
Contributor Author

rikatz commented Jul 29, 2021

sure. Which file? I want to separate one file per new contributor :)

@ritwizsinha
Copy link

I would like to work on it, I am still learning the basics with daily sessions with @longwuyuan, I would like to improve tests for this
file https://github.com/kubernetes/ingress-nginx/blob/main/test/e2e/annotations/backendprotocol.go

@gdsoumya
Copy link
Contributor

gdsoumya commented Aug 2, 2021

@yashikabadaya
Copy link
Contributor

@bhumijgupta
Copy link
Member

@rikatz
Copy link
Contributor Author

rikatz commented Aug 2, 2021

Added names to the description.

Will later check more tests needing to be evolved

@longwuyuan
Copy link
Contributor

longwuyuan commented Aug 2, 2021 via email

@rikatz
Copy link
Contributor Author

rikatz commented Aug 2, 2021

/reopen

@k8s-ci-robot
Copy link
Contributor

@rikatz: Reopened this issue.

In response to this:

/reopen

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/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
7 participants