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/27 05:10:17 UTC

[GitHub] [apisix-dashboard] idbeta opened a new pull request #893: test: add route with priority

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


   Please answer these questions before submitting a pull request
   
   - Why submit this pull request?
   - [x] E2E test
   - [ ] New feature provided
   - [ ] Improve performance
   
   - Related issues
   https://github.com/apache/apisix-dashboard/issues/635


----------------------------------------------------------------
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] idbeta commented on a change in pull request #893: test: add route with priority

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



##########
File path: api/test/e2e/route_with_priority_test.go
##########
@@ -0,0 +1,150 @@
+/*
+ * 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"
+)
+
+func TestRoute_with_priority(t *testing.T) {
+	tests := []HttpTestCase{
+		{
+			caseDesc: "add route with priority (-1)",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					  "uri": "/server_port",
+					  "methods": ["GET"],
+					  "priority": -1,
+					  "upstream": {
+						  "type": "roundrobin",
+						  "nodes": [{
+							  "host": "172.16.238.20",
+							  "port": 1980,
+							  "weight": 1
+						  }]
+					  }
+				  }`,
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+		},
+		{
+			caseDesc:     "verify route",
+			Object:       APISIXExpect(t),
+			Method:       http.MethodGet,
+			Path:         "/server_port",
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+			ExpectBody:   "1980",
+			Sleep:        sleepTime,
+		},
+		{
+			caseDesc: "add route with no priority (default 0), upstream is different from the others",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r2",
+			Body: `{
+					  "uri": "/server_port",
+					  "methods": ["GET"],
+					  "upstream": {
+						  "type": "roundrobin",
+						  "nodes": [{
+							  "host": "172.16.238.20",
+							  "port": 1981,
+							  "weight": 1
+						  }]
+					  }
+				  }`,
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+		},
+		{
+			caseDesc:     "verify route",
+			Object:       APISIXExpect(t),
+			Method:       http.MethodGet,
+			Path:         "/server_port",
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+			ExpectBody:   "1981",
+			Sleep:        sleepTime,
+		},
+		{
+			caseDesc: "add another route with valid priority (1), upstream is different from the others",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r3",
+			Body: `{
+					 "uri": "/server_port",
+					 "methods": ["GET"],
+					 "priority": 1,
+					 "upstream": {
+						 "type": "roundrobin",
+						 "nodes": [{
+							 "host": "172.16.238.20",
+							 "port": 1982,
+							 "weight": 1
+						 }]
+					 }
+				 }`,
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+		},
+		{
+			caseDesc:     "verify route",
+			Object:       APISIXExpect(t),
+			Method:       http.MethodGet,
+			Path:         "/server_port",
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+			ExpectBody:   "1982",
+			Sleep:        sleepTime,
+		},
+		{
+			caseDesc:     "delete route",

Review comment:
       fixed




----------------------------------------------------------------
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] idbeta commented on a change in pull request #893: test: add route with priority

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



##########
File path: api/test/e2e/route_with_priority_test.go
##########
@@ -0,0 +1,150 @@
+/*
+ * 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"
+)
+
+func TestRoute_with_priority(t *testing.T) {
+	tests := []HttpTestCase{
+		{
+			caseDesc: "add route with priority (-1)",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					  "uri": "/server_port",
+					  "methods": ["GET"],
+					  "priority": -1,

Review comment:
       ok, I removed case which priority is a negative number. It is a `hidden attribute`.




----------------------------------------------------------------
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 #893: test: add route with priority

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


   > do we support -1 as priority?
   
   Yes, we support now. 
   
   here is the comparison step: https://github.com/api7/lua-resty-radixtree/blob/master/lib/resty/radixtree.lua#L179


----------------------------------------------------------------
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 pull request #893: test: add route with priority

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


   > Please answer these questions before submitting a pull request
   > 
   > 
   > 
   > - Why submit this pull request?
   > 
   > - [x] E2E test
   > 
   > - [ ] New feature provided
   > 
   > - [ ] Improve performance
   > 
   > 
   > 
   > - Related issues
   > 
   > https://github.com/apache/apisix-dashboard/issues/635
   
   Again, is this or will close #635?
   Please learn from other PRs first


----------------------------------------------------------------
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 a change in pull request #893: test: add route with priority

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



##########
File path: api/test/e2e/route_with_priority_test.go
##########
@@ -0,0 +1,150 @@
+/*
+ * 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"
+)
+
+func TestRoute_with_priority(t *testing.T) {
+	tests := []HttpTestCase{
+		{
+			caseDesc: "add route with priority (-1)",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					  "uri": "/server_port",

Review comment:
       nice catch




----------------------------------------------------------------
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] idbeta commented on a change in pull request #893: test: add route with priority

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



##########
File path: api/test/e2e/route_with_priority_test.go
##########
@@ -0,0 +1,108 @@
+/*
+ * 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"
+)
+
+func TestRoute_with_priority(t *testing.T) {
+	tests := []HttpTestCase{
+		{
+			caseDesc: "add another route with no priority (default 0)",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					  "uri": "/server_port",

Review comment:
       When testing route priority, routes of different priorities need to use the same uri, and different routes return different content to determine whether the priority meets expectations, so I used the `/servert_port`.




----------------------------------------------------------------
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] codecov-io edited a comment on pull request #893: test: add route with priority

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #893:
URL: https://github.com/apache/apisix-dashboard/pull/893#issuecomment-734648205


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=h1) Report
   > Merging [#893](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=desc) (1134727) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/0a826e6ce9cbd253da1e39a5e3e960c7746d62ce?el=desc) (0a826e6) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/893/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master     #893   +/-   ##
   =======================================
     Coverage   43.03%   43.03%           
   =======================================
     Files          18       18           
     Lines        1271     1271           
   =======================================
     Hits          547      547           
     Misses        632      632           
     Partials       92       92           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=footer). Last update [0a826e6...1134727](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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 a change in pull request #893: test: add route with priority

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



##########
File path: api/test/e2e/route_with_priority_test.go
##########
@@ -0,0 +1,150 @@
+/*
+ * 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"
+)
+
+func TestRoute_with_priority(t *testing.T) {
+	tests := []HttpTestCase{
+		{
+			caseDesc: "add route with priority (-1)",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					  "uri": "/server_port",
+					  "methods": ["GET"],
+					  "priority": -1,
+					  "upstream": {
+						  "type": "roundrobin",
+						  "nodes": [{
+							  "host": "172.16.238.20",
+							  "port": 1980,
+							  "weight": 1
+						  }]
+					  }
+				  }`,
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+		},
+		{
+			caseDesc:     "verify route",
+			Object:       APISIXExpect(t),
+			Method:       http.MethodGet,
+			Path:         "/server_port",
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+			ExpectBody:   "1980",
+			Sleep:        sleepTime,
+		},
+		{
+			caseDesc: "add route with no priority (default 0), upstream is different from the others",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r2",
+			Body: `{
+					  "uri": "/server_port",
+					  "methods": ["GET"],
+					  "upstream": {
+						  "type": "roundrobin",
+						  "nodes": [{
+							  "host": "172.16.238.20",
+							  "port": 1981,
+							  "weight": 1
+						  }]
+					  }
+				  }`,
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+		},
+		{
+			caseDesc:     "verify route",
+			Object:       APISIXExpect(t),
+			Method:       http.MethodGet,
+			Path:         "/server_port",
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+			ExpectBody:   "1981",
+			Sleep:        sleepTime,
+		},
+		{
+			caseDesc: "add another route with valid priority (1), upstream is different from the others",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r3",
+			Body: `{
+					 "uri": "/server_port",
+					 "methods": ["GET"],
+					 "priority": 1,
+					 "upstream": {
+						 "type": "roundrobin",
+						 "nodes": [{
+							 "host": "172.16.238.20",
+							 "port": 1982,
+							 "weight": 1
+						 }]
+					 }
+				 }`,
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+		},
+		{
+			caseDesc:     "verify route",
+			Object:       APISIXExpect(t),
+			Method:       http.MethodGet,
+			Path:         "/server_port",
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+			ExpectBody:   "1982",
+			Sleep:        sleepTime,
+		},
+		{
+			caseDesc:     "delete route",

Review comment:
        Need a better desc

##########
File path: api/test/e2e/route_with_priority_test.go
##########
@@ -0,0 +1,150 @@
+/*
+ * 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"
+)
+
+func TestRoute_with_priority(t *testing.T) {
+	tests := []HttpTestCase{
+		{
+			caseDesc: "add route with priority (-1)",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					  "uri": "/server_port",
+					  "methods": ["GET"],
+					  "priority": -1,
+					  "upstream": {
+						  "type": "roundrobin",
+						  "nodes": [{
+							  "host": "172.16.238.20",
+							  "port": 1980,
+							  "weight": 1
+						  }]
+					  }
+				  }`,
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+		},
+		{
+			caseDesc:     "verify route",
+			Object:       APISIXExpect(t),
+			Method:       http.MethodGet,
+			Path:         "/server_port",
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+			ExpectBody:   "1980",
+			Sleep:        sleepTime,
+		},
+		{
+			caseDesc: "add route with no priority (default 0), upstream is different from the others",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r2",
+			Body: `{
+					  "uri": "/server_port",
+					  "methods": ["GET"],
+					  "upstream": {
+						  "type": "roundrobin",
+						  "nodes": [{
+							  "host": "172.16.238.20",
+							  "port": 1981,
+							  "weight": 1
+						  }]
+					  }
+				  }`,
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+		},
+		{
+			caseDesc:     "verify route",
+			Object:       APISIXExpect(t),
+			Method:       http.MethodGet,
+			Path:         "/server_port",
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+			ExpectBody:   "1981",
+			Sleep:        sleepTime,
+		},
+		{
+			caseDesc: "add another route with valid priority (1), upstream is different from the others",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r3",
+			Body: `{
+					 "uri": "/server_port",
+					 "methods": ["GET"],
+					 "priority": 1,
+					 "upstream": {
+						 "type": "roundrobin",
+						 "nodes": [{
+							 "host": "172.16.238.20",
+							 "port": 1982,
+							 "weight": 1
+						 }]
+					 }
+				 }`,
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+		},
+		{
+			caseDesc:     "verify route",
+			Object:       APISIXExpect(t),
+			Method:       http.MethodGet,
+			Path:         "/server_port",
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+			ExpectBody:   "1982",
+			Sleep:        sleepTime,
+		},
+		{
+			caseDesc:     "delete route",
+			Object:       MangerApiExpect(t),
+			Method:       http.MethodDelete,
+			Path:         "/apisix/admin/routes/r1",
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+			Sleep:        sleepTime,
+		},
+		{
+			caseDesc:     "delete route",

Review comment:
       ditto 




----------------------------------------------------------------
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] idbeta commented on pull request #893: test: add route with priority

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


   > > Please answer these questions before submitting a pull request
   > > 
   > > * Why submit this pull request?
   > > * [x]  E2E test
   > > * [ ]  New feature provided
   > > * [ ]  Improve performance
   > > * Related issues
   > > 
   > > #635
   > 
   > Again, is this PR will close #635?
   > Please learn from other PRs first
   
   fixed. ping @moonming 


----------------------------------------------------------------
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] nic-chen commented on a change in pull request #893: test: add route with priority

Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #893:
URL: https://github.com/apache/apisix-dashboard/pull/893#discussion_r532121656



##########
File path: api/test/e2e/route_with_priority_test.go
##########
@@ -0,0 +1,150 @@
+/*
+ * 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"
+)
+
+func TestRoute_with_priority(t *testing.T) {
+	tests := []HttpTestCase{
+		{
+			caseDesc: "add route with priority (-1)",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					  "uri": "/server_port",

Review comment:
       never use /server_port,unless you are testing multi upstream nodes.




----------------------------------------------------------------
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 #893: test: add route with priority

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



##########
File path: api/test/e2e/route_with_priority_test.go
##########
@@ -0,0 +1,150 @@
+/*
+ * 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"
+)
+
+func TestRoute_with_priority(t *testing.T) {
+	tests := []HttpTestCase{
+		{
+			caseDesc: "add route with priority (-1)",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					  "uri": "/server_port",
+					  "methods": ["GET"],
+					  "priority": -1,

Review comment:
       do we support -1 as priority?




----------------------------------------------------------------
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 edited a comment on pull request #893: test: add route with priority

Posted by GitBox <gi...@apache.org>.
moonming edited a comment on pull request #893:
URL: https://github.com/apache/apisix-dashboard/pull/893#issuecomment-735478876


   > Please answer these questions before submitting a pull request
   > 
   > 
   > 
   > - Why submit this pull request?
   > 
   > - [x] E2E test
   > 
   > - [ ] New feature provided
   > 
   > - [ ] Improve performance
   > 
   > 
   > 
   > - Related issues
   > 
   > https://github.com/apache/apisix-dashboard/issues/635
   
   Again, is this PR will close #635?
   Please learn from other PRs first


----------------------------------------------------------------
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] nic-chen commented on a change in pull request #893: test: add route with priority

Posted by GitBox <gi...@apache.org>.
nic-chen commented on a change in pull request #893:
URL: https://github.com/apache/apisix-dashboard/pull/893#discussion_r532224016



##########
File path: api/test/e2e/route_with_priority_test.go
##########
@@ -0,0 +1,150 @@
+/*
+ * 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"
+)
+
+func TestRoute_with_priority(t *testing.T) {
+	tests := []HttpTestCase{
+		{
+			caseDesc: "add route with priority (-1)",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					  "uri": "/server_port",

Review comment:
       Sorry, I didn't see that this is the test priority, and it does need to be distinguished by port, but I suggest that multiple routes be created before verification, and the description is written more clearly.
   




----------------------------------------------------------------
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] codecov-io commented on pull request #893: test: add route with priority

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #893:
URL: https://github.com/apache/apisix-dashboard/pull/893#issuecomment-734648205


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=h1) Report
   > Merging [#893](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=desc) (ba933a1) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/0a826e6ce9cbd253da1e39a5e3e960c7746d62ce?el=desc) (0a826e6) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/893/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master     #893   +/-   ##
   =======================================
     Coverage   43.03%   43.03%           
   =======================================
     Files          18       18           
     Lines        1271     1271           
   =======================================
     Hits          547      547           
     Misses        632      632           
     Partials       92       92           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=footer). Last update [0a826e6...ba933a1](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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 #893: test: add route with priority

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



##########
File path: api/test/e2e/route_with_priority_test.go
##########
@@ -0,0 +1,108 @@
+/*
+ * 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"
+)
+
+func TestRoute_with_priority(t *testing.T) {
+	tests := []HttpTestCase{
+		{
+			caseDesc: "add another route with no priority (default 0)",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					  "uri": "/server_port",
+					  "methods": ["GET"],
+					  "upstream": {
+						  "type": "roundrobin",
+						  "nodes": [{
+							  "host": "172.16.238.20",
+							  "port": 1981,
+							  "weight": 1
+						  }]
+					  }
+				  }`,
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+		},
+		{
+			caseDesc:     "access the route",
+			Object:       APISIXExpect(t),
+			Method:       http.MethodGet,
+			Path:         "/server_port",
+			ExpectStatus: http.StatusOK,
+			ExpectBody:   "1981",
+			Sleep:        sleepTime,
+		},
+		{
+			caseDesc: "add another route with valid priority (1), upstream is different from the others",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,

Review comment:
       we need to test the `get` method of manager API

##########
File path: api/test/e2e/route_with_priority_test.go
##########
@@ -0,0 +1,108 @@
+/*
+ * 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"
+)
+
+func TestRoute_with_priority(t *testing.T) {
+	tests := []HttpTestCase{
+		{
+			caseDesc: "add another route with no priority (default 0)",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					  "uri": "/server_port",
+					  "methods": ["GET"],
+					  "upstream": {
+						  "type": "roundrobin",
+						  "nodes": [{
+							  "host": "172.16.238.20",
+							  "port": 1981,
+							  "weight": 1
+						  }]
+					  }
+				  }`,
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+		},
+		{
+			caseDesc:     "access the route",
+			Object:       APISIXExpect(t),
+			Method:       http.MethodGet,
+			Path:         "/server_port",
+			ExpectStatus: http.StatusOK,
+			ExpectBody:   "1981",
+			Sleep:        sleepTime,
+		},
+		{
+			caseDesc: "add another route with valid priority (1), upstream is different from the others",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,

Review comment:
       typo!!!! `MangerApiExpect`
   what is `Manger`? @nic-chen @idbeta Please take it seriously!!!
   

##########
File path: api/test/e2e/route_with_priority_test.go
##########
@@ -0,0 +1,108 @@
+/*
+ * 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"
+)
+
+func TestRoute_with_priority(t *testing.T) {
+	tests := []HttpTestCase{
+		{
+			caseDesc: "add another route with no priority (default 0)",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					  "uri": "/server_port",

Review comment:
       why use `/server_port`?




----------------------------------------------------------------
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] idbeta commented on a change in pull request #893: test: add route with priority

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



##########
File path: api/test/e2e/route_with_priority_test.go
##########
@@ -0,0 +1,150 @@
+/*
+ * 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"
+)
+
+func TestRoute_with_priority(t *testing.T) {
+	tests := []HttpTestCase{
+		{
+			caseDesc: "add route with priority (-1)",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					  "uri": "/server_port",
+					  "methods": ["GET"],
+					  "priority": -1,

Review comment:
       yes, I have tested the priority of -2, -1, etc. and found that the priority supports negative values and conforms to the documentation, ` Larger value means higher priority. `.




----------------------------------------------------------------
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 #893: test: add route with priority

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



##########
File path: api/test/e2e/route_with_priority_test.go
##########
@@ -0,0 +1,150 @@
+/*
+ * 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"
+)
+
+func TestRoute_with_priority(t *testing.T) {
+	tests := []HttpTestCase{
+		{
+			caseDesc: "add route with priority (-1)",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					  "uri": "/server_port",
+					  "methods": ["GET"],
+					  "priority": -1,
+					  "upstream": {
+						  "type": "roundrobin",
+						  "nodes": [{
+							  "host": "172.16.238.20",
+							  "port": 1980,
+							  "weight": 1
+						  }]
+					  }
+				  }`,
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+		},
+		{
+			caseDesc:     "access the route to determine whether it meets the priority (pnly -1)",

Review comment:
       What is pnly?




----------------------------------------------------------------
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] idbeta commented on a change in pull request #893: test: add route with priority

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



##########
File path: api/test/e2e/route_with_priority_test.go
##########
@@ -0,0 +1,108 @@
+/*
+ * 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"
+)
+
+func TestRoute_with_priority(t *testing.T) {
+	tests := []HttpTestCase{
+		{
+			caseDesc: "add another route with no priority (default 0)",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					  "uri": "/server_port",
+					  "methods": ["GET"],
+					  "upstream": {
+						  "type": "roundrobin",
+						  "nodes": [{
+							  "host": "172.16.238.20",
+							  "port": 1981,
+							  "weight": 1
+						  }]
+					  }
+				  }`,
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+		},
+		{
+			caseDesc:     "access the route",
+			Object:       APISIXExpect(t),
+			Method:       http.MethodGet,
+			Path:         "/server_port",
+			ExpectStatus: http.StatusOK,
+			ExpectBody:   "1981",
+			Sleep:        sleepTime,
+		},
+		{
+			caseDesc: "add another route with valid priority (1), upstream is different from the others",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,

Review comment:
       fixed. ping @moonming Can you review it when you have time?




----------------------------------------------------------------
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] nic-chen merged pull request #893: test: add route with priority (E2E)

Posted by GitBox <gi...@apache.org>.
nic-chen merged pull request #893:
URL: https://github.com/apache/apisix-dashboard/pull/893


   


----------------------------------------------------------------
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 a change in pull request #893: test: add route with priority

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



##########
File path: api/test/e2e/route_with_priority_test.go
##########
@@ -0,0 +1,150 @@
+/*
+ * 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"
+)
+
+func TestRoute_with_priority(t *testing.T) {
+	tests := []HttpTestCase{
+		{
+			caseDesc: "add route with priority (-1)",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					  "uri": "/server_port",

Review comment:
       ping @idbeta 




----------------------------------------------------------------
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 a change in pull request #893: test: add route with priority

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



##########
File path: api/test/e2e/route_with_priority_test.go
##########
@@ -0,0 +1,150 @@
+/*
+ * 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"
+)
+
+func TestRoute_with_priority(t *testing.T) {
+	tests := []HttpTestCase{
+		{
+			caseDesc: "add route with priority (-1)",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					  "uri": "/server_port",

Review comment:
       Could we add this tip to Testcase Guide?




----------------------------------------------------------------
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] idbeta commented on a change in pull request #893: test: add route with priority

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



##########
File path: api/test/e2e/route_with_priority_test.go
##########
@@ -0,0 +1,150 @@
+/*
+ * 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"
+)
+
+func TestRoute_with_priority(t *testing.T) {
+	tests := []HttpTestCase{
+		{
+			caseDesc: "add route with priority (-1)",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					  "uri": "/server_port",

Review comment:
       this case is test the route priority, need the same uri to compare priority, in the current test docker container, `/server_port` is a more suitable uri.




----------------------------------------------------------------
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] idbeta commented on a change in pull request #893: test: add route with priority

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



##########
File path: api/test/e2e/route_with_priority_test.go
##########
@@ -0,0 +1,150 @@
+/*
+ * 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"
+)
+
+func TestRoute_with_priority(t *testing.T) {
+	tests := []HttpTestCase{
+		{
+			caseDesc: "add route with priority (-1)",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					  "uri": "/server_port",
+					  "methods": ["GET"],
+					  "priority": -1,

Review comment:
       ping @moonming 




----------------------------------------------------------------
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] codecov-io edited a comment on pull request #893: test: add route with priority

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #893:
URL: https://github.com/apache/apisix-dashboard/pull/893#issuecomment-734648205


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=h1) Report
   > Merging [#893](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=desc) (df96d82) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/0a826e6ce9cbd253da1e39a5e3e960c7746d62ce?el=desc) (0a826e6) will **decrease** coverage by `0.07%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/893/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #893      +/-   ##
   ==========================================
   - Coverage   43.03%   42.95%   -0.08%     
   ==========================================
     Files          18       18              
     Lines        1271     1271              
   ==========================================
   - Hits          547      546       -1     
   - Misses        632      633       +1     
     Partials       92       92              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/893/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `78.28% <0.00%> (-0.66%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=footer). Last update [0a826e6...df96d82](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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] idbeta commented on a change in pull request #893: test: add route with priority

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



##########
File path: api/test/e2e/route_with_priority_test.go
##########
@@ -0,0 +1,150 @@
+/*
+ * 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"
+)
+
+func TestRoute_with_priority(t *testing.T) {
+	tests := []HttpTestCase{
+		{
+			caseDesc: "add route with priority (-1)",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					  "uri": "/server_port",
+					  "methods": ["GET"],
+					  "priority": -1,
+					  "upstream": {
+						  "type": "roundrobin",
+						  "nodes": [{
+							  "host": "172.16.238.20",
+							  "port": 1980,
+							  "weight": 1
+						  }]
+					  }
+				  }`,
+			Headers:      map[string]string{"Authorization": token},
+			ExpectStatus: http.StatusOK,
+		},
+		{
+			caseDesc:     "access the route to determine whether it meets the priority (pnly -1)",

Review comment:
       fixed.




----------------------------------------------------------------
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] codecov-io edited a comment on pull request #893: test: add route with priority

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #893:
URL: https://github.com/apache/apisix-dashboard/pull/893#issuecomment-734648205


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=h1) Report
   > Merging [#893](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=desc) (438c9fb) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/a7d8e13e0f97b4636ab8a35576a848c0bf004221?el=desc) (a7d8e13) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/893/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master     #893   +/-   ##
   =======================================
     Coverage   42.82%   42.82%           
   =======================================
     Files          18       18           
     Lines        1289     1289           
   =======================================
     Hits          552      552           
     Misses        645      645           
     Partials       92       92           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=footer). Last update [a7d8e13...438c9fb](https://codecov.io/gh/apache/apisix-dashboard/pull/893?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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 #893: test: add route with priority

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



##########
File path: api/test/e2e/route_with_priority_test.go
##########
@@ -0,0 +1,150 @@
+/*
+ * 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"
+)
+
+func TestRoute_with_priority(t *testing.T) {
+	tests := []HttpTestCase{
+		{
+			caseDesc: "add route with priority (-1)",
+			Object:   MangerApiExpect(t),
+			Method:   http.MethodPut,
+			Path:     "/apisix/admin/routes/r1",
+			Body: `{
+					  "uri": "/server_port",
+					  "methods": ["GET"],
+					  "priority": -1,

Review comment:
       I think negative numbers are meaningless, maybe https://github.com/api7/lua-resty-radixtree should not allow negative numbers as a priority




----------------------------------------------------------------
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] idbeta commented on pull request #893: test: add route with priority

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


   > Again, is this PR will close #635?
   > Please learn from other PRs first
   
   yes, ping @moonming 


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