tao12345666333 commented on a change in pull request #942:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/942#discussion_r841047144



##########
File path: test/e2e/features/global_rule.go
##########
@@ -64,8 +98,8 @@ spec:
                _, ok := grs[0].Plugins["prometheus"]
                assert.Equal(ginkgo.GinkgoT(), ok, true)
 
-               resp := 
s.NewAPISIXClient().GET("/apisix/prometheus/metrics").Expect()
-               resp.Status(200)
+               resp := 
s.NewAPISIXClient().GET("/apisix/prometheus/metrics").WithHeader("Host", 
"httpbin.org").Expect()

Review comment:
       ditto. The name.

##########
File path: test/e2e/features/global_rule.go
##########
@@ -56,6 +59,37 @@ spec:
                // Wait until the ApisixClusterConfig create event was 
delivered.
                time.Sleep(3 * time.Second)
 
+               arr := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2beta3
+kind: ApisixRoute
+metadata:
+  name: httpbin-route
+spec:
+  http:
+  - name: public-api
+    match:
+      hosts:
+      - httpbin.org

Review comment:
       ditto

##########
File path: test/e2e/features/global_rule.go
##########
@@ -56,6 +59,37 @@ spec:
                // Wait until the ApisixClusterConfig create event was 
delivered.
                time.Sleep(3 * time.Second)
 
+               arr := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2beta3
+kind: ApisixRoute
+metadata:
+  name: httpbin-route

Review comment:
       Maybe changing the name would be better, this route has nothing to do 
with httpbin

##########
File path: test/e2e/features/global_rule.go
##########
@@ -56,6 +59,37 @@ spec:
                // Wait until the ApisixClusterConfig create event was 
delivered.
                time.Sleep(3 * time.Second)
 
+               arr := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2beta3
+kind: ApisixRoute
+metadata:
+  name: httpbin-route
+spec:
+  http:
+  - name: public-api
+    match:
+      hosts:
+      - httpbin.org
+      paths:
+      - /apisix/prometheus/metrics
+    backends:
+    - serviceName: %s
+      servicePort: %d
+    plugins:
+    - name: public-api
+      enable: true
+`, adminSvc, adminPort)
+
+               err = s.CreateResourceFromString(arr)
+               assert.Nil(ginkgo.GinkgoT(), err, "creating ApisixRouteConfig")
+
+               defer func() {
+                       err := s.RemoveResourceByString(arr)
+                       assert.Nil(ginkgo.GinkgoT(), err)
+               }()

Review comment:
       We don't need this either, after the test is done, it will be cleaned up 
automatically




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to