Refactor e2e Tests to use common helper function
Each e2e test is creating the same(or similar) Ingress Resource in different ways. This makes common ingress resource creation be performed by a framework method, reducing code duplication
This commit is contained in:
parent
808c2be914
commit
44a11898d8
9 changed files with 207 additions and 643 deletions
|
|
@ -39,11 +39,13 @@ var _ = framework.IngressNginxDescribe("Annotations - custom default-backend", f
|
|||
Context("when default backend annotation is enabled", func() {
|
||||
It("should use a custom default backend as upstream", func() {
|
||||
host := "default-backend"
|
||||
|
||||
annotations := map[string]string{
|
||||
"nginx.ingress.kubernetes.io/default-backend": "http-svc",
|
||||
}
|
||||
ing, err := f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.IngressController.Namespace, "invalid", 80, &annotations))
|
||||
|
||||
ing := framework.NewSingleIngress(host, "/", host, f.IngressController.Namespace, "invalid", 80, &annotations)
|
||||
_, err := f.EnsureIngress(ing)
|
||||
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(ing).NotTo(BeNil())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue