Skip to content

Commit f8bf5a3

Browse files
authored
chore: remove echo from snippet tests (#10110)
Signed-off-by: Spazzy <[email protected]>
1 parent 08158df commit f8bf5a3

File tree

1 file changed

+30
-16
lines changed

1 file changed

+30
-16
lines changed

test/e2e/annotations/snippet.go

+30-16
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,25 @@ import (
2626
)
2727

2828
var _ = framework.DescribeAnnotation("configuration-snippet", func() {
29-
f := framework.NewDefaultFramework("configurationsnippet")
29+
f := framework.NewDefaultFramework(
30+
"configurationsnippet",
31+
framework.WithHTTPBunEnabled(),
32+
)
3033

31-
ginkgo.BeforeEach(func() {
32-
f.NewEchoDeployment()
33-
})
34-
35-
ginkgo.It(`set snippet "more_set_headers "Foo1: Bar1";" in all locations"`, func() {
34+
ginkgo.It("set snippet more_set_headers in all locations", func() {
3635
host := "configurationsnippet.foo.com"
3736
annotations := map[string]string{
38-
"nginx.ingress.kubernetes.io/configuration-snippet": `
39-
more_set_headers "Foo1: Bar1";`,
37+
"nginx.ingress.kubernetes.io/configuration-snippet": `more_set_headers "Foo1: Bar1";`,
4038
}
4139

42-
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, annotations)
43-
f.EnsureIngress(ing)
40+
f.EnsureIngress(framework.NewSingleIngress(
41+
host,
42+
"/",
43+
host,
44+
f.Namespace,
45+
framework.HTTPBunService,
46+
80,
47+
annotations))
4448

4549
f.WaitForNginxServer(host,
4650
func(server string) bool {
@@ -51,23 +55,32 @@ var _ = framework.DescribeAnnotation("configuration-snippet", func() {
5155
GET("/").
5256
WithHeader("Host", host).
5357
Expect().
54-
Status(http.StatusOK).Headers().
58+
Status(http.StatusOK).
59+
Headers().
5560
ValueEqual("Foo1", []string{"Bar1"})
5661
})
5762

58-
ginkgo.It(`drops snippet "more_set_headers "Foo1: Bar1";" in all locations if disabled by admin"`, func() {
63+
ginkgo.It("drops snippet more_set_header in all locations if disabled by admin", func() {
5964
host := "noconfigurationsnippet.foo.com"
6065
annotations := map[string]string{
61-
"nginx.ingress.kubernetes.io/configuration-snippet": `
62-
more_set_headers "Foo1: Bar1";`,
66+
"nginx.ingress.kubernetes.io/configuration-snippet": `more_set_headers "Foo1: Bar1";`,
6367
}
6468

65-
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, annotations)
69+
ing := framework.NewSingleIngress(
70+
host,
71+
"/",
72+
host,
73+
f.Namespace,
74+
framework.HTTPBunService,
75+
80,
76+
annotations)
77+
6678
f.UpdateNginxConfigMapData("allow-snippet-annotations", "false")
6779
defer func() {
6880
// Return to the original value
6981
f.UpdateNginxConfigMapData("allow-snippet-annotations", "true")
7082
}()
83+
7184
// Sleep a while just to guarantee that the configmap is applied
7285
framework.Sleep()
7386
f.EnsureIngress(ing)
@@ -81,7 +94,8 @@ var _ = framework.DescribeAnnotation("configuration-snippet", func() {
8194
GET("/").
8295
WithHeader("Host", host).
8396
Expect().
84-
Status(http.StatusOK).Headers().
97+
Status(http.StatusOK).
98+
Headers().
8599
NotContainsKey("Foo1")
86100
})
87101
})

0 commit comments

Comments
 (0)