This is an automated email from the ASF dual-hosted git repository.
tokers pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git
The following commit(s) were added to refs/heads/master by this push:
new 607cebd ci: install and start minikube manully (#210)
607cebd is described below
commit 607cebdbf566c7bc18c5494757c73e531dedf026
Author: Alex Zhang <[email protected]>
AuthorDate: Tue Jan 26 15:36:49 2021 +0800
ci: install and start minikube manully (#210)
---
.github/workflows/e2e-test-ci.yml | 15 ++++++++----
Makefile | 9 +++----
test/e2e/e2e.go | 50 +--------------------------------------
utils/minikube.sh | 36 ++++++++++++++++++++++++++++
4 files changed, 52 insertions(+), 58 deletions(-)
diff --git a/.github/workflows/e2e-test-ci.yml
b/.github/workflows/e2e-test-ci.yml
index ff4f400..979ea62 100644
--- a/.github/workflows/e2e-test-ci.yml
+++ b/.github/workflows/e2e-test-ci.yml
@@ -7,31 +7,36 @@ on:
pull_request:
branches:
- master
- - test/e2e-sanity-case
+ - ci/e2e
jobs:
e2e-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install minikube
- uses: abstractj/setup-minikube@issue-12
+ run: |
+ sh ./utils/minikube.sh
- name: Output cluster info
run: kubectl cluster-info
- name: Add images
run: |
IMAGE_TAG=dev make build-image
- minikube cache add apache/apisix:latest -v 7 --alsologtostderr
+ minikube cache add apache/apisix-ingress-controller:dev -v 7
--alsologtostderr
+ minikube cache add apache/apisix:dev -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 apisix-ingress-controller:dev -v 7
--alsologtostderr
- name: Setup Go Env
uses: actions/setup-go@v1
with:
go-version: '1.13'
+ - name: Install ginkgo
+ run: |
+ go get -u github.com/onsi/ginkgo/ginkgo
+ sudo cp ~/go/bin/ginkgo /usr/local/bin
- name: Run e2e test cases
working-directory: ./
run: |
- make e2e-test
+ make e2e-test E2E_SKIP_BUILD=1 E2E_CONCURRENCY=2
- name: upload coverage profile
working-directory: ./test/e2e
run: |
diff --git a/Makefile b/Makefile
index 1d01c1b..05c3fcb 100644
--- a/Makefile
+++ b/Makefile
@@ -61,11 +61,12 @@ unit-test:
### e2e-test: Run e2e test cases (minikube is required)
e2e-test: ginkgo-check build-image-to-minikube
- 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
&& \
+ kubectl apply -f $(PWD)/samples/deploy/crd/v1beta1/ApisixRoute.yaml
+ kubectl apply -f $(PWD)/samples/deploy/crd/v1beta1/ApisixUpstream.yaml
+ kubectl apply -f $(PWD)/samples/deploy/crd/v1beta1/ApisixService.yaml
+ kubectl apply -f $(PWD)/samples/deploy/crd/v1beta1/ApisixTls.yaml
cd test/e2e && ginkgo -cover -coverprofile=coverage.txt -r
--randomizeSuites --randomizeAllSpecs --trace -p --nodes=$(E2E_CONCURRENCY)
+
.PHONY: ginkgo-check
ginkgo-check:
ifeq ("$(wildcard $(GINKGO))", "")
diff --git a/test/e2e/e2e.go b/test/e2e/e2e.go
index bb77051..c4e944d 100644
--- a/test/e2e/e2e.go
+++ b/test/e2e/e2e.go
@@ -15,56 +15,8 @@
package e2e
import (
- "os"
-
- "github.com/gruntwork-io/terratest/modules/k8s"
- "github.com/onsi/ginkgo"
-
_ "github.com/api7/ingress-controller/test/e2e/endpoints"
_ "github.com/api7/ingress-controller/test/e2e/ingress"
- "github.com/api7/ingress-controller/test/e2e/scaffold"
)
-var (
- _apisixRouteDef string
- _apisixUpstreamDef string
- _apisixServiceDef string
- _apisixTLSDef string
-)
-
-func runE2E() {
- if v := os.Getenv("APISIX_ROUTE_DEF"); v != "" {
- _apisixRouteDef = v
- } else {
- panic("no specified ApisixRoute definition file")
- }
- if v := os.Getenv("APISIX_UPSTREAM_DEF"); v != "" {
- _apisixUpstreamDef = v
- } else {
- panic("no specified ApisixUpstream resource definition file")
- }
- if v := os.Getenv("APISIX_UPSTREAM_DEF"); v != "" {
- _apisixUpstreamDef = v
- } else {
- panic("no specified ApisixUpstream resource definition file")
- }
- if v := os.Getenv("APISIX_SERVICE_DEF"); v != "" {
- _apisixServiceDef = v
- } else {
- panic("no specified ApisixService resource definition file")
- }
- if v := os.Getenv("APISIX_TLS_DEF"); v != "" {
- _apisixTLSDef = v
- } else {
- panic("no specified ApisixTls resource definition file")
- }
-
- kubeconfig := scaffold.GetKubeconfig()
- opts := &k8s.KubectlOptions{
- ConfigPath: kubeconfig,
- }
- k8s.KubectlApply(ginkgo.GinkgoT(), opts, _apisixRouteDef)
- k8s.KubectlApply(ginkgo.GinkgoT(), opts, _apisixUpstreamDef)
- k8s.KubectlApply(ginkgo.GinkgoT(), opts, _apisixServiceDef)
- k8s.KubectlApply(ginkgo.GinkgoT(), opts, _apisixTLSDef)
-}
+func runE2E() {}
diff --git a/utils/minikube.sh b/utils/minikube.sh
new file mode 100644
index 0000000..3c4086c
--- /dev/null
+++ b/utils/minikube.sh
@@ -0,0 +1,36 @@
+#
+# 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.
+#
+
+install_kubectl() {
+ curl -LO "https://dl.k8s.io/release/$(curl -L -s
https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
+ install -m 0755 kubectl /usr/local/bin/kubectl
+ kubectl version --client
+}
+
+install_minikube() {
+ curl -LO
https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
+ sudo install minikube-linux-amd64 /usr/local/bin/minikube
+ minikube version
+}
+
+start_minikube() {
+ minikube start
+}
+
+install_kubectl
+install_minikube
+start_minikube