You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/11/25 12:29:20 UTC

[GitHub] [apisix-dashboard] idbeta opened a new pull request #875: test: add E2E testcase about #631

idbeta opened a new pull request #875:
URL: https://github.com/apache/apisix-dashboard/pull/875


   Please answer these questions before submitting a pull request
   
   - Why submit this pull request?
   - [x] E2E testcase
   - [ ] New feature provided
   - [ ] Improve performance
   
   - Related issues
   
   #872 #873


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] moonming commented on a change in pull request #875: test: add E2E testcase for #872 #873

Posted by GitBox <gi...@apache.org>.
moonming commented on a change in pull request #875:
URL: https://github.com/apache/apisix-dashboard/pull/875#discussion_r530422283



##########
File path: api/test/e2e/route_e2e_remote_addr_rarescen_test.go
##########
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ package e2e
+
+ import (
+	 "net/http"
+	 "testing"
+	 //  "time"
+	 //  "github.com/stretchr/testify/assert"
+	 //  "github.com/tidwall/gjson"
+ )
+ 
+ func TestRoute_add_with_invalid_remote_addr_rarescen(t *testing.T) {
+	 tests := []HttpTestCase{
+		 {
+			 caseDesc: "config route with invalid remote_addrs",
+			 Object:   MangerApiExpect(t),
+			 Method:   http.MethodPut,
+			 Path:     "/apisix/admin/routes/r1",
+			 Body: `{
+						"uri": "/test_uri",
+						"remote_addrs": "127.0.0.1",
+						"upstream": {
+							"type": "roundrobin",
+							"nodes": {
+								"172.16.238.20:1980": 1
+							}
+						}
+					}`,
+			 Headers:      map[string]string{"Authorization": token},
+			 ExpectStatus: http.StatusBadRequest,

Review comment:
       still not test data plane. is this unit test or e2e?

##########
File path: api/test/e2e/route_e2e_remote_addr_rarescen_test.go
##########
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ package e2e
+
+ import (
+	 "net/http"
+	 "testing"
+	 //  "time"
+	 //  "github.com/stretchr/testify/assert"
+	 //  "github.com/tidwall/gjson"
+ )
+ 
+ func TestRoute_add_with_invalid_remote_addr_rarescen(t *testing.T) {

Review comment:
       what is “ratescen”?

##########
File path: api/test/e2e/route_e2e_remote_addr_rarescen_test.go
##########
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ package e2e
+
+ import (
+	 "net/http"
+	 "testing"
+	 //  "time"
+	 //  "github.com/stretchr/testify/assert"
+	 //  "github.com/tidwall/gjson"
+ )
+ 
+ func TestRoute_add_with_invalid_remote_addr_rarescen(t *testing.T) {
+	 tests := []HttpTestCase{
+		 {
+			 caseDesc: "config route with invalid remote_addrs",
+			 Object:   MangerApiExpect(t),
+			 Method:   http.MethodPut,
+			 Path:     "/apisix/admin/routes/r1",
+			 Body: `{
+						"uri": "/test_uri",
+						"remote_addrs": "127.0.0.1",
+						"upstream": {
+							"type": "roundrobin",
+							"nodes": {
+								"172.16.238.20:1980": 1
+							}
+						}
+					}`,
+			 Headers:      map[string]string{"Authorization": token},
+			 ExpectStatus: http.StatusBadRequest,
+		 },
+		 {
+			caseDesc: "config route with remote_addr and remote_addrs at the same time",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					   "uri": "/test_uri",
+					   "remote_addrs": ["127.0.0.1","192.168.0.1"],
+					   "remote_addr": "127.0.0.1",
+					   "upstream": {
+						   "type": "roundrobin",
+						   "nodes": {
+							   "172.16.238.20:1980": 1
+						   }
+					   }
+				   }`,
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusBadRequest,
+		},
+	 }
+ 
+	 for _, tc := range tests {
+		 testCaseCheck(tc)
+	 }
+ }
+ 
+ //Teardown
+ func TestConsumer_teardown(t *testing.T) {
+	 _ = []HttpTestCase{
+		 {
+			 caseDesc:     "delete route",
+			 Object:       MangerApiExpect(t),
+			 Method:       http.MethodDelete,
+			 Path:         "/apisix/admin/routes/r1",

Review comment:
       this router is not created, why delete will return 200?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] membphis commented on pull request #875: test: add E2E testcase for #872 #873

Posted by GitBox <gi...@apache.org>.
membphis commented on pull request #875:
URL: https://github.com/apache/apisix-dashboard/pull/875#issuecomment-733777368


   we should use a useful title


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] membphis commented on pull request #875: test: add E2E testcase for #872 #873

Posted by GitBox <gi...@apache.org>.
membphis commented on pull request #875:
URL: https://github.com/apache/apisix-dashboard/pull/875#issuecomment-734036449


   related issues: #872  #873 
   
   one PR for one thing, so I think we have to close this PR


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] membphis commented on pull request #875: test: add E2E testcase for #872 #873

Posted by GitBox <gi...@apache.org>.
membphis commented on pull request #875:
URL: https://github.com/apache/apisix-dashboard/pull/875#issuecomment-734039045


   #872 : milestone 2.2
   #873 : milestone 2.1.1
   
   @idbeta you can add the test cases in the issue, it is a better way
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan commented on pull request #875: test: add E2E testcase for #631

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #875:
URL: https://github.com/apache/apisix-dashboard/pull/875#issuecomment-733678316


   Kindly add resolve keywords before issue number is needed. 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] membphis closed pull request #875: test: add E2E testcase for #872 #873

Posted by GitBox <gi...@apache.org>.
membphis closed pull request #875:
URL: https://github.com/apache/apisix-dashboard/pull/875


   


----------------------------------------------------------------
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:
users@infra.apache.org