starsz commented on a change in pull request #1598:
URL: https://github.com/apache/apisix-dashboard/pull/1598#discussion_r596082431



##########
File path: api/test/e2enew/service/service_test.go
##########
@@ -462,3 +463,83 @@ var _ = ginkgo.Describe("service update use patch method", 
func() {
                })
        })
 })
+
+var _ = ginkgo.Describe("test service delete", func() {
+       t := ginkgo.GinkgoT()
+       var createServiceBody map[string]interface{} = map[string]interface{}{
+               "name": "testservice",
+               "upstream": map[string]interface{}{
+                       "type": "roundrobin",
+                       "nodes": []map[string]interface{}{
+                               {
+                                       "host":   base.UpstreamIp,
+                                       "port":   1980,
+                                       "weight": 1,
+                               },
+                       },
+               },
+       }
+       _createServiceBody, err := json.Marshal(createServiceBody)
+       assert.Nil(t, err)
+
+       table.DescribeTable("test service delete",

Review comment:
       IMO, different test cases test different features.
   The former case tests the feature of creating a service and test it in DP.
   This test case is testing for the relation of service and upstream (we can't 
delete service when the service is used by routes.
   
   If this case tests the DP, I think the former test doesn't have mean to 
exist.

##########
File path: api/test/e2enew/service/service_test.go
##########
@@ -462,3 +463,83 @@ var _ = ginkgo.Describe("service update use patch method", 
func() {
                })
        })
 })
+
+var _ = ginkgo.Describe("test service delete", func() {
+       t := ginkgo.GinkgoT()
+       var createServiceBody map[string]interface{} = map[string]interface{}{
+               "name": "testservice",
+               "upstream": map[string]interface{}{
+                       "type": "roundrobin",
+                       "nodes": []map[string]interface{}{
+                               {
+                                       "host":   base.UpstreamIp,
+                                       "port":   1980,
+                                       "weight": 1,
+                               },
+                       },
+               },
+       }
+       _createServiceBody, err := json.Marshal(createServiceBody)
+       assert.Nil(t, err)
+
+       table.DescribeTable("test service delete",

Review comment:
       IMO, different test cases test different features.
   The former case tests the feature of creating a service and test it in DP.
   This test case is testing for the relation of service and upstream (we can't 
delete service when the service is used by routes.
   
   If this case tests the DP, I think the former test doesn't have means to 
exist.




----------------------------------------------------------------
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.

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


Reply via email to