gxthrj commented on a change in pull request #122:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/122#discussion_r548451582



##########
File path: Makefile
##########
@@ -48,6 +49,14 @@ gofmt:
 unit-test:
        go test -cover -coverprofile=coverage.txt ./...
 
+### e2e-test:         Run e2e test cases
+e2e-test:
+       export 
APISIX_ROUTE_DEF=$(PWD)/samples/deploy/crd/v1beta1/ApisixRoute.yaml && \
+       export 
APISIX_UPSTREAM_DEF=$(PWD)/samples/deploy/crd/v1beta1/ApisixUpstream.yaml && \
+       export 
APISIX_SERVICE_DEF=$(PWD)/samples/deploy/crd/v1beta1/ApisixService.yaml && \
+       export APISIX_TLS_DEF=$(PWD)/samples/deploy/crd/v1beta1/ApisixTls.yaml 
&& \
+       cd test/e2e && go test github.com/api7/ingress-controller/test/e2e

Review comment:
       We can add test coverage here .

##########
File path: test/e2e/ingress/sanity.go
##########
@@ -0,0 +1,62 @@
+// 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 ingress
+
+import (
+       "encoding/json"
+       "net/http"
+
+       "github.com/onsi/ginkgo"
+       "github.com/stretchr/testify/assert"
+
+       "github.com/api7/ingress-controller/test/e2e/scaffold"
+)
+
+type ip struct {
+       IP string `json:"ip"`
+}
+
+var _ = ginkgo.Describe("single-route", func() {
+       s := scaffold.NewDefaultScaffold()
+       ginkgo.It("/ip should return your ip", func() {
+               backendSvc, backendSvcPort := s.DefaultHTTPBackend()
+               s.CreateApisixRoute("httpbin-route", []scaffold.ApisixRouteRule{
+                       {
+                               Host: "httpbin.com",
+                               HTTP: scaffold.ApisixRouteRuleHTTP{
+                                       Paths: 
[]scaffold.ApisixRouteRuleHTTPPath{
+                                               {
+                                                       Path: "/ip",
+                                                       Backend: 
scaffold.ApisixRouteRuleHTTPBackend{
+                                                               ServiceName: 
backendSvc,
+                                                               ServicePort: 
backendSvcPort[0],
+                                                       },
+                                               },
+                                       },
+                               },
+                       },
+               })

Review comment:
       I think we need to use yaml to manage the creation of `ApisixRoute`, In 
this way, we can simulate the user's usage scenario test conversion process.
   
   This is an enhancement and will not block PR .

##########
File path: test/e2e/testdata/apisix-gw-config-default.yaml
##########
@@ -59,6 +59,7 @@ apisix:
 
   allow_admin:                  # 
http://nginx.org/en/docs/http/ngx_http_access_module.html#allow
     - 127.0.0.0/24              # If we don't set any IP list, then any IP 
access is allowed by default.
+    - 0.0.0.0/0

Review comment:
       Should remove this.  Had add this in 
`test/e2e/testdata/apisix-gw-config.yaml` already.

##########
File path: .github/workflows/e2e-test-ci.yml
##########
@@ -0,0 +1,33 @@
+name: e2e-test-ci
+
+on:
+  push:
+    branches:
+      - master
+  pull_request:
+    branches:
+      - master
+      - test/e2e-sanity-case
+jobs:
+  e2e-test:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - name: Install minikube
+        uses: abstractj/setup-minikube@issue-12
+      - name: Output cluster info
+        run: kubectl cluster-info
+      - name: Add images
+        run: |
+          minikube cache add apache/apisix:latest -v 7 --alsologtostderr
+          minikube cache add bitnami/etcd:3.4.14-debian-10-r0 -v 7 
--alsologtostderr
+          minikube cache add kennethreitz/httpbin -v 7 --alsologtostderr
+          minikube cache add viewking/apisix-ingress-controller:dev -v 7 
--alsologtostderr

Review comment:
       Why adding `viewking/apisix-ingress-controller:dev` cache ?
   Do we need to deploy `apisix-ingress-controller`in minikube ?




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