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 2022/04/15 07:26:27 UTC

[GitHub] [apisix-ingress-controller] Chever-John commented on a diff in pull request #965: ci: add consumer-restriction plugin test cases for e2e

Chever-John commented on code in PR #965:
URL: https://github.com/apache/apisix-ingress-controller/pull/965#discussion_r851110876


##########
test/e2e/suite-plugins/consumer-restriction.go:
##########
@@ -0,0 +1,260 @@
+// 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 plugins
+
+import (
+	"encoding/base64"
+	"fmt"
+	"net/http"
+	"time"
+
+	"github.com/onsi/ginkgo"
+	"github.com/stretchr/testify/assert"
+
+	"github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
+)
+
+func CreateBasicAuthConsumer(name, username, password string) string {

Review Comment:
   Hi, @tao12345666333 @AlinsRan 
   I don't think the function here should be pulled out separately. You could put it in the scaffold folder(or file) if you wanted to do that. Then you can use it by calling the function, but that would mean that every test file should do that and the scaffold folder would become bloated.
   
   I know **[DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)** pricinple. But maybe we do not need it here.



-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org