This is an automated email from the ASF dual-hosted git repository.
zhangjintao 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 628abb94 ci: upgrade e2e-test-ci (#1149)
628abb94 is described below
commit 628abb945f7bc515bd5fcccf1479443305236478
Author: Xin Rong <[email protected]>
AuthorDate: Mon Jul 18 14:28:20 2022 +0800
ci: upgrade e2e-test-ci (#1149)
---
.github/actions/e2e/action.yaml | 69 ------------
.github/workflows/e2e-test-ci.yml | 99 ++++++++++++++++-
Makefile | 118 +++++++++++++--------
pkg/kube/translation/apisix_route_test.go | 2 +-
test/e2e/README.md | 2 +-
test/e2e/e2e.go | 4 +-
test/e2e/scaffold/etcd.go | 2 +-
test/e2e/scaffold/httpbin.go | 2 +-
test/e2e/scaffold/ingress.go | 2 +-
test/e2e/suite-annotations/websocket.go | 6 +-
test/e2e/{suite-chaos => suite-chore}/chaos.go | 4 +-
test/e2e/{suite-config => suite-chore}/config.go | 28 ++++-
.../{suite-endpoints => suite-chore}/endpoints.go | 94 +++++++---------
test/e2e/suite-config/manifests.go | 39 -------
test/e2e/suite-features/websocket.go | 2 +-
.../suite-ingress-features/resourcesync.go | 2 +
.../suite-ingress-resource/resourcepushing.go | 22 +---
.../suite-plugins/suite-plugins-general/echo.go | 6 +-
.../suite-plugins-general/redirect.go | 6 +-
.../suite-plugins-other/plugin_config.go | 18 ++--
.../suite-plugins/suite-plugins-security/cors.go | 12 ++-
.../suite-plugins-security/ip-restriction.go | 7 +-
.../suite-plugins-security/uri_blocker.go | 6 +-
.../suite-plugins-traffic/limit_count.go | 6 +-
.../suite-plugins-traffic/request_id.go | 6 +-
.../fault_injection.go | 6 +-
utils/kind-with-registry.sh | 1 -
27 files changed, 284 insertions(+), 287 deletions(-)
diff --git a/.github/actions/e2e/action.yaml b/.github/actions/e2e/action.yaml
deleted file mode 100644
index d553eeb9..00000000
--- a/.github/actions/e2e/action.yaml
+++ /dev/null
@@ -1,69 +0,0 @@
-#
-# 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.
-
-name: Run E2E tests
-description: "Run an E2E test suite"
-
-inputs:
- testsuite_name:
- description: "Name of the test suite to run"
- required: true
- concurrency:
- description: "Number of concurrent test runs"
- required: false
- default: '2'
-
-runs:
- using: "composite"
- steps:
- - uses: actions/checkout@v2
- with:
- submodules: recursive
-
- - name: Install kind
- shell: bash
- run: |
- curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64
- chmod +x ./kind
- sudo mv kind /usr/local/bin
-
- - name: Setup Go Env
- uses: actions/setup-go@v2
- with:
- go-version: "1.18"
-
- - name: Install ginkgo
- shell: bash
- run: |
- go install github.com/onsi/ginkgo/v2/[email protected]
- sudo cp ~/go/bin/ginkgo /usr/local/bin
-
- - name: Create K8s cluster
- shell: bash
- run: |
- make kind-up
- kubectl wait --for=condition=Ready nodes --all
-
- - name: Run E2E test suite
- shell: bash
- env:
- E2E_FOCUS: "${{ inputs.testsuite_name }}*"
- E2E_CONCURRENCY: "${{ inputs.concurrency }}"
- ENABLE_PROXY: "false"
- run: |
- make e2e-test
diff --git a/.github/workflows/e2e-test-ci.yml
b/.github/workflows/e2e-test-ci.yml
index f6a3fff9..5d9d34f1 100644
--- a/.github/workflows/e2e-test-ci.yml
+++ b/.github/workflows/e2e-test-ci.yml
@@ -61,6 +61,63 @@ jobs:
- 'test/e2e/**/*'
- 'conf/**'
- 'utils/**'
+ build:
+ name: Build
+ runs-on: ubuntu-latest
+ needs: changes
+
+ steps:
+
+ - name: Checkout
+ uses: actions/checkout@v3 # v3.0.2
+
+ - name: Set up Go 1.18
+ id: go
+ uses: actions/setup-go@v3 # v3.2.0
+ with:
+ go-version: '1.18'
+
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v2 #v2.0.0
+
+ - name: Set up Docker Buildx
+ id: buildx
+ uses: docker/setup-buildx-action@v2 # v2.0.0
+ with:
+ version: latest
+
+ - name: Prepare Host
+ run: |
+ curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64
+ chmod +x ./kind
+ sudo mv kind /usr/local/bin
+
+ - name: Build images
+ env:
+ TAG: dev
+ ARCH: amd64
+ REGISTRY: localhost:5000
+ ENABLE_PROXY: "false"
+ run: |
+ echo "building images..."
+ make clean-image build-images
+
+ echo "creating images cache..."
+ docker save \
+ localhost:5000/apache/apisix:dev \
+ localhost:5000/bitnami/etcd:dev \
+ localhost:5000/apache/apisix-ingress-controller:dev \
+ localhost:5000/kennethreitz/httpbin:dev \
+ localhost:5000/test-backend:dev \
+ localhost:5000/jmalloc/echo-server:dev \
+ localhost:5000/busybox:dev \
+ | pigz > docker.tar.gz
+
+ - name: cache
+ uses: actions/upload-artifact@v3 # v3.1.0
+ with:
+ name: docker.tar.gz
+ path: docker.tar.gz
prepare:
needs: changes
@@ -84,15 +141,49 @@ jobs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
e2e-test:
- needs: prepare
+ needs:
+ - changes
+ - prepare
+ - build
runs-on: ubuntu-latest
strategy:
fail-fast: false # If false, GitHub will not cancels all in-progress
jobs in the matrix if any matrix job fails.
matrix:
suite: ${{ fromJson(needs.prepare.outputs.matrix) }}
steps:
- - uses: actions/checkout@v2
+ - name: Checkout
+ uses: actions/checkout@v2
+ with:
+ submodules: recursive
- - uses: ./.github/actions/e2e
+ - name: Install ginkgo
+ run: |
+ go install github.com/onsi/ginkgo/v2/[email protected]
+ sudo cp ~/go/bin/ginkgo /usr/local/bin
+
+ - name: cache
+ uses: actions/download-artifact@v2 # v2
with:
- testsuite_name: ${{ matrix.suite }}
+ name: docker.tar.gz
+
+ - name: Create K8s cluster
+ shell: bash
+ run: |
+ make kind-up
+ kubectl wait --for=condition=Ready nodes --all
+
+ - name: Load images from cache
+ run: |
+ echo "loading docker images..."
+ pigz -dc docker.tar.gz | docker load
+ make push-images
+
+ - name: Run E2E test suite
+ shell: bash
+ env:
+ E2E_FOCUS: "${{ matrix.suite }}"
+ ENABLE_PROXY: "false"
+ E2E_SKIP_BUILD: "1"
+ E2E_FLAKE_ATTEMPTS: "2"
+ run: |
+ make e2e-test
diff --git a/Makefile b/Makefile
index 829e0cbb..cada8d1a 100644
--- a/Makefile
+++ b/Makefile
@@ -38,7 +38,8 @@
VERSYM="github.com/apache/apisix-ingress-controller/pkg/version._buildVersion"
GITSHASYM="github.com/apache/apisix-ingress-controller/pkg/version._buildGitRevision"
BUILDOSSYM="github.com/apache/apisix-ingress-controller/pkg/version._buildOS"
GO_LDFLAGS ?= "-X=$(VERSYM)=$(VERSION) -X=$(GITSHASYM)=$(GITSHA)
-X=$(BUILDOSSYM)=$(OSNAME)/$(OSARCH)"
-E2E_CONCURRENCY ?= 2
+E2E_NODES ?= 4
+E2E_FLAKE_ATTEMPTS ?= 0
E2E_SKIP_BUILD ?= 0
### build: Build apisix-ingress-controller
@@ -49,11 +50,67 @@ build:
-ldflags $(GO_LDFLAGS) \
main.go
+### clean-image: clean apisix-ingress-controller image
+.PHONY: clean-image
+clean-image: ## Removes local image
+ echo "removing old image
$(REGISTRY)/apache/apisix-ingress-controller:$(IMAGE_TAG)"
+ docker rmi -f $(REGISTRY)/apache/apisix-ingress-controller:$(IMAGE_TAG)
|| true
+
### build-image: Build apisix-ingress-controller image
.PHONY: build-image
build-image:
docker build -t apache/apisix-ingress-controller:$(IMAGE_TAG)
--build-arg ENABLE_PROXY=true .
+### pack-ingress-image: Build and push Ingress image used in e2e test suites
to kind or custom registry.
+.PHONY: pack-ingress-image
+pack-ingress-image:
+ docker build -t apache/apisix-ingress-controller:$(IMAGE_TAG)
--build-arg ENABLE_PROXY=$(ENABLE_PROXY) .
+ docker tag apache/apisix-ingress-controller:$(IMAGE_TAG)
$(REGISTRY)/apache/apisix-ingress-controller:$(IMAGE_TAG)
+ docker push $(REGISTRY)/apache/apisix-ingress-controller:$(IMAGE_TAG)
+
+### pack-images: Build and push images used in e2e test suites to kind or
custom registry.
+.PHONY: pack-images
+pack-images: build-images push-images
+
+### build-image: Build apisix-ingress-controller image
+.PHONY: build-images
+build-images:
+ifeq ($(E2E_SKIP_BUILD), 0)
+ docker pull apache/apisix:2.13.1-alpine
+ docker tag apache/apisix:2.13.1-alpine
$(REGISTRY)/apache/apisix:$(IMAGE_TAG)
+
+ docker pull bitnami/etcd:3.4.14-debian-10-r0
+ docker tag bitnami/etcd:3.4.14-debian-10-r0
$(REGISTRY)/bitnami/etcd:$(IMAGE_TAG)
+
+ docker pull kennethreitz/httpbin
+ docker tag kennethreitz/httpbin
$(REGISTRY)/kennethreitz/httpbin:$(IMAGE_TAG)
+
+ docker build -t test-backend:$(IMAGE_TAG) --build-arg
ENABLE_PROXY=$(ENABLE_PROXY) ./test/e2e/testbackend
+ docker tag test-backend:$(IMAGE_TAG)
$(REGISTRY)/test-backend:$(IMAGE_TAG)
+
+ docker build -t apache/apisix-ingress-controller:$(IMAGE_TAG)
--build-arg ENABLE_PROXY=$(ENABLE_PROXY) .
+ docker tag apache/apisix-ingress-controller:$(IMAGE_TAG)
$(REGISTRY)/apache/apisix-ingress-controller:$(IMAGE_TAG)
+
+ docker pull jmalloc/echo-server:latest
+ docker tag jmalloc/echo-server:latest
$(REGISTRY)/jmalloc/echo-server:$(IMAGE_TAG)
+
+ docker pull busybox:1.28
+ docker tag busybox:1.28 $(REGISTRY)/busybox:$(IMAGE_TAG)
+endif
+
+### push-images: Push images used in e2e test suites to kind or
custom registry.
+.PHONY: push-images
+push-images:
+ifeq ($(E2E_SKIP_BUILD), 0)
+ docker push $(REGISTRY)/apache/apisix:$(IMAGE_TAG)
+ docker push $(REGISTRY)/bitnami/etcd:$(IMAGE_TAG)
+ docker push $(REGISTRY)/kennethreitz/httpbin:$(IMAGE_TAG)
+ docker push $(REGISTRY)/test-backend:$(IMAGE_TAG)
+ docker push $(REGISTRY)/apache/apisix-ingress-controller:$(IMAGE_TAG)
+ docker push $(REGISTRY)/jmalloc/echo-server:$(IMAGE_TAG)
+ docker push $(REGISTRY)/busybox:$(IMAGE_TAG)
+endif
+
### lint: Do static lint check
.PHONY: lint
lint:
@@ -66,13 +123,13 @@ unit-test:
### e2e-test: Run e2e test cases (in existing clusters directly)
.PHONY: e2e-test
-e2e-test: ginkgo-check push-images e2e-wolf-rbac
+e2e-test: ginkgo-check pack-images e2e-wolf-rbac
kubectl apply -k $(PWD)/samples/deploy/crd
kubectl apply -f $(PWD)/samples/deploy/gateway-api
cd test/e2e \
&& go mod download \
&& export REGISTRY=$(REGISTRY) \
- && ACK_GINKGO_RC=true ginkgo -cover -coverprofile=coverage.txt
-r --randomize-all --randomize-suites --trace --nodes=$(E2E_CONCURRENCY)
--focus=$(E2E_FOCUS)
+ && ACK_GINKGO_RC=true ginkgo -cover -coverprofile=coverage.txt
-r --randomize-all --randomize-suites --trace --nodes=$(E2E_NODES)
--focus=$(E2E_FOCUS) --flake-attempts=$(E2E_FLAKE_ATTEMPTS)
### e2e-test-local: Run e2e test cases (kind is required)
.PHONY: e2e-test-local
@@ -85,47 +142,6 @@ ifeq ("$(wildcard $(GINKGO))", "")
exit 1
endif
-
-### push-ingress-images: Build and push Ingress image used in e2e test suites
to kind or custom registry.
-.PHONY: push-ingress-images
-push-ingress-images:
- docker build -t apache/apisix-ingress-controller:$(IMAGE_TAG)
--build-arg ENABLE_PROXY=$(ENABLE_PROXY) .
- docker tag apache/apisix-ingress-controller:$(IMAGE_TAG)
$(REGISTRY)/apache/apisix-ingress-controller:$(IMAGE_TAG)
- docker push $(REGISTRY)/apache/apisix-ingress-controller:$(IMAGE_TAG)
-
-### push-images: Push images used in e2e test suites to kind or custom
registry.
-.PHONY: push-images
-push-images:
-ifeq ($(E2E_SKIP_BUILD), 0)
- docker pull apache/apisix:2.13.1-alpine
- docker tag apache/apisix:2.13.1-alpine $(REGISTRY)/apache/apisix:dev
- docker push $(REGISTRY)/apache/apisix:dev
-
- docker pull bitnami/etcd:3.4.14-debian-10-r0
- docker tag bitnami/etcd:3.4.14-debian-10-r0
$(REGISTRY)/bitnami/etcd:3.4.14-debian-10-r0
- docker push $(REGISTRY)/bitnami/etcd:3.4.14-debian-10-r0
-
- docker pull kennethreitz/httpbin
- docker tag kennethreitz/httpbin $(REGISTRY)/kennethreitz/httpbin
- docker push $(REGISTRY)/kennethreitz/httpbin
-
- docker build -t test-backend:$(IMAGE_TAG) --build-arg
ENABLE_PROXY=$(ENABLE_PROXY) ./test/e2e/testbackend
- docker tag test-backend:$(IMAGE_TAG)
$(REGISTRY)/test-backend:$(IMAGE_TAG)
- docker push $(REGISTRY)/test-backend:$(IMAGE_TAG)
-
- docker build -t apache/apisix-ingress-controller:$(IMAGE_TAG)
--build-arg ENABLE_PROXY=$(ENABLE_PROXY) .
- docker tag apache/apisix-ingress-controller:$(IMAGE_TAG)
$(REGISTRY)/apache/apisix-ingress-controller:$(IMAGE_TAG)
- docker push $(REGISTRY)/apache/apisix-ingress-controller:$(IMAGE_TAG)
-
- docker pull jmalloc/echo-server:latest
- docker tag jmalloc/echo-server:latest
$(REGISTRY)/jmalloc/echo-server:latest
- docker push $(REGISTRY)/jmalloc/echo-server:latest
-
- docker pull busybox:1.28
- docker tag busybox:1.28 $(REGISTRY)/busybox:1.28
- docker push $(REGISTRY)/busybox:1.28
-endif
-
### kind-up: Launch a Kubernetes cluster with a image registry by
Kind.
.PHONY: kind-up
kind-up:
@@ -225,7 +241,19 @@ ifeq ("$(E2E_FOCUS)", "")
chmod +x ./test/e2e/testdata/wolf-rbac/cmd.sh &&
./test/e2e/testdata/wolf-rbac/cmd.sh start
endif
ifneq ("$(E2E_FOCUS)", "")
- echo $(E2E_FOCUS) | grep -E
'suite-plugins-authentication|consumer|wolf|suite-plugins' || exit 0 \
+ echo $(E2E_FOCUS) | grep -E
'suite-plugins-authentication|consumer|wolf' || exit 0 \
&& chmod +x ./test/e2e/testdata/wolf-rbac/cmd.sh \
&& ./test/e2e/testdata/wolf-rbac/cmd.sh start
endif
+
+### kind-load-images: Load the images to the kind cluster
+.PHONY: kind-load-images
+kind-load-images:
+ kind load docker-image --name=apisix \
+ localhost:5000/apache/apisix:dev \
+ localhost:5000/bitnami/etcd:dev \
+ localhost:5000/apache/apisix-ingress-controller:dev \
+ localhost:5000/kennethreitz/httpbin:dev \
+ localhost:5000/test-backend:dev \
+ localhost:5000/jmalloc/echo-server:dev \
+ localhost:5000/busybox:dev
diff --git a/pkg/kube/translation/apisix_route_test.go
b/pkg/kube/translation/apisix_route_test.go
index 1d733aa0..720dd59a 100644
--- a/pkg/kube/translation/apisix_route_test.go
+++ b/pkg/kube/translation/apisix_route_test.go
@@ -267,7 +267,7 @@ func mockTranslatorV2beta3(t *testing.T) (*translator,
<-chan struct{}) {
},
}
- processCh := make(chan struct{})
+ processCh := make(chan struct{}, 2)
svcInformer.AddEventHandler(cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
processCh <- struct{}{}
diff --git a/test/e2e/README.md b/test/e2e/README.md
index f399d209..c915a617 100644
--- a/test/e2e/README.md
+++ b/test/e2e/README.md
@@ -55,7 +55,7 @@ Run `make e2e-test-local` to run the e2e test suites in your
development environ
Run `make e2e-test` to run the e2e test suites in an existing cluster, you can
specify custom registry by passing REGISTRY(eg docker.io).
Step `1` and `2` can be skipped by passing `E2E_SKIP_BUILD=1` to this
directive, also, you can customize the
-running concurrency of e2e test suites by passing `E2E_CONCURRENCY=X` where
`X` is the desired number of cases running in parallel.
+running concurrency of e2e test suites by passing `E2E_NODES=X` where `X` is
the desired number of cases running in parallel.
You can run specific test cases by passing the environment variable
`E2E_FOCUS=suite-<suite name>`, where `<suite name>` can be found under
`test/e2e` directory.
For example, `E2E_FOCUS=suite-plugins* make e2e-test` will only run test cases
in `test/e2e/suite-plugins` directory.
diff --git a/test/e2e/e2e.go b/test/e2e/e2e.go
index 5d8ba27b..eb6389be 100644
--- a/test/e2e/e2e.go
+++ b/test/e2e/e2e.go
@@ -16,9 +16,7 @@ package e2e
import (
_
"github.com/apache/apisix-ingress-controller/test/e2e/suite-annotations"
- _ "github.com/apache/apisix-ingress-controller/test/e2e/suite-chaos"
- _ "github.com/apache/apisix-ingress-controller/test/e2e/suite-config"
- _ "github.com/apache/apisix-ingress-controller/test/e2e/suite-endpoints"
+ _ "github.com/apache/apisix-ingress-controller/test/e2e/suite-chore"
_ "github.com/apache/apisix-ingress-controller/test/e2e/suite-features"
_ "github.com/apache/apisix-ingress-controller/test/e2e/suite-gateway"
_
"github.com/apache/apisix-ingress-controller/test/e2e/suite-ingress/suite-ingress-features"
diff --git a/test/e2e/scaffold/etcd.go b/test/e2e/scaffold/etcd.go
index 661ec467..97485fb1 100644
--- a/test/e2e/scaffold/etcd.go
+++ b/test/e2e/scaffold/etcd.go
@@ -65,7 +65,7 @@ spec:
tcpSocket:
port: 2379
timeoutSeconds: 2
- image: "localhost:5000/bitnami/etcd:3.4.14-debian-10-r0"
+ image: "localhost:5000/bitnami/etcd:dev"
imagePullPolicy: IfNotPresent
name: etcd-deployment-e2e-test
ports:
diff --git a/test/e2e/scaffold/httpbin.go b/test/e2e/scaffold/httpbin.go
index 9c96ec2c..96563ff5 100644
--- a/test/e2e/scaffold/httpbin.go
+++ b/test/e2e/scaffold/httpbin.go
@@ -63,7 +63,7 @@ spec:
tcpSocket:
port: 80
timeoutSeconds: 2
- image: "localhost:5000/kennethreitz/httpbin"
+ image: "localhost:5000/kennethreitz/httpbin:dev"
imagePullPolicy: IfNotPresent
name: httpbin-deployment-e2e-test
ports:
diff --git a/test/e2e/scaffold/ingress.go b/test/e2e/scaffold/ingress.go
index ed7c1748..1e712033 100644
--- a/test/e2e/scaffold/ingress.go
+++ b/test/e2e/scaffold/ingress.go
@@ -234,7 +234,7 @@ spec:
terminationGracePeriodSeconds: 0
initContainers:
- name: wait-apisix-admin
- image: localhost:5000/busybox:1.28
+ image: localhost:5000/busybox:dev
imagePullPolicy: IfNotPresent
command: ['sh', '-c', "until nc -z
apisix-service-e2e-test.%s.svc.cluster.local 9180 ; do echo waiting for
apisix-admin; sleep 2; done;"]
containers:
diff --git a/test/e2e/suite-annotations/websocket.go
b/test/e2e/suite-annotations/websocket.go
index 2a5b27a6..c7bf6d2c 100644
--- a/test/e2e/suite-annotations/websocket.go
+++ b/test/e2e/suite-annotations/websocket.go
@@ -40,7 +40,7 @@ metadata:
spec:
containers:
- name: websocket-server
- image: localhost:5000/jmalloc/echo-server:latest
+ image: localhost:5000/jmalloc/echo-server:dev
ports:
- containerPort: 8080
---
@@ -126,7 +126,7 @@ metadata:
spec:
containers:
- name: websocket-server
- image: localhost:5000/jmalloc/echo-server:latest
+ image: localhost:5000/jmalloc/echo-server:dev
ports:
- containerPort: 8080
---
@@ -210,7 +210,7 @@ metadata:
spec:
containers:
- name: websocket-server
- image: localhost:5000/jmalloc/echo-server:latest
+ image: localhost:5000/jmalloc/echo-server:dev
ports:
- containerPort: 8080
---
diff --git a/test/e2e/suite-chaos/chaos.go b/test/e2e/suite-chore/chaos.go
similarity index 97%
rename from test/e2e/suite-chaos/chaos.go
rename to test/e2e/suite-chore/chaos.go
index a4adf608..79cffa2d 100644
--- a/test/e2e/suite-chaos/chaos.go
+++ b/test/e2e/suite-chore/chaos.go
@@ -12,7 +12,7 @@
// 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 chaos
+package chore
import (
"fmt"
@@ -24,7 +24,7 @@ import (
"github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
)
-var _ = ginkgo.Describe("suite-chaos: Chaos Testing", func() {
+var _ = ginkgo.Describe("suite-chore: Chaos Testing", func() {
s := scaffold.NewDefaultScaffold()
ginkgo.Context("simulate apisix deployment restart", func() {
ginkgo.Specify("ingress controller can synchronize rules
normally after apisix recovery", func() {
diff --git a/test/e2e/suite-config/config.go b/test/e2e/suite-chore/config.go
similarity index 81%
rename from test/e2e/suite-config/config.go
rename to test/e2e/suite-chore/config.go
index 1279d369..33f50b50 100644
--- a/test/e2e/suite-config/config.go
+++ b/test/e2e/suite-chore/config.go
@@ -12,7 +12,7 @@
// 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 config
+package chore
import (
"context"
@@ -27,7 +27,31 @@ import (
"github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
)
-var _ = ginkgo.Describe("suite-config: deploy ingress controller with config",
func() {
+const (
+ _ingressAPISIXConfigMapTemplate = `
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: ingress-apisix-controller-config
+data:
+ config.yaml: |
+ apisix:
+ default_cluster_base_url: "{{.DEFAULT_CLUSTER_BASE_URL}}"
+ default_cluster_admin_key: "{{.DEFAULT_CLUSTER_ADMIN_KEY}}"
+ log_level: "debug"
+ log_output: "stdout"
+ http_listen: ":8080"
+ https_listen: ":8443"
+ enable_profiling: true
+ kubernetes:
+ namespace_selector:
+ - %s
+ apisix_route_version: "apisix.apache.org/v2beta3"
+ watch_endpoint_slices: true
+`
+)
+
+var _ = ginkgo.Describe("suite-chore: deploy ingress controller with config",
func() {
s := scaffold.NewDefaultScaffold()
ginkgo.It("use configmap with env", func() {
label := fmt.Sprintf("apisix.ingress.watch=%s", s.Namespace())
diff --git a/test/e2e/suite-endpoints/endpoints.go
b/test/e2e/suite-chore/endpoints.go
similarity index 65%
rename from test/e2e/suite-endpoints/endpoints.go
rename to test/e2e/suite-chore/endpoints.go
index e4aa36df..3ae145fe 100644
--- a/test/e2e/suite-endpoints/endpoints.go
+++ b/test/e2e/suite-chore/endpoints.go
@@ -12,11 +12,12 @@
// 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 endpoints
+package chore
import (
"fmt"
"net/http"
+ "time"
ginkgo "github.com/onsi/ginkgo/v2"
"github.com/stretchr/testify/assert"
@@ -24,7 +25,7 @@ import (
"github.com/apache/apisix-ingress-controller/test/e2e/scaffold"
)
-var _ = ginkgo.Describe("suite-endpoints: endpoints", func() {
+var _ = ginkgo.Describe("suite-chore: endpoints", func() {
suites := func(s *scaffold.Scaffold) {
ginkgo.It("ignore applied only if there is an ApisixRoute
referenced", func() {
backendSvc, backendSvcPort := s.DefaultHTTPBackend()
@@ -110,69 +111,56 @@ spec:
s.NewAPISIXClient().GET("/ip").WithHeader("Host",
"httpbin.com").Expect().Status(http.StatusServiceUnavailable)
})
}
- ginkgo.Describe("suite-endpoints: scaffold v2beta3", func() {
+ ginkgo.Describe("suite-chore: scaffold v2beta3", func() {
suites(scaffold.NewDefaultScaffold())
})
- ginkgo.Describe("suite-endpoints: scaffold v2", func() {
+ ginkgo.Describe("suite-chore: scaffold v2", func() {
suites(scaffold.NewDefaultV2Scaffold())
})
})
-var _ = ginkgo.Describe("suite-endpoints: port usage", func() {
- suites := func(s *scaffold.Scaffold) {
- ginkgo.It("service port != target port", func() {
- backendSvc, backendSvcPort := s.DefaultHTTPBackend()
- apisixRoute := fmt.Sprintf(`
-apiVersion: apisix.apache.org/v2beta3
-kind: ApisixRoute
+var _ = ginkgo.Describe("suite-chore: port usage", func() {
+ s := scaffold.NewDefaultScaffold()
+ ginkgo.It("service port != target port", func() {
+ backendSvc, backendSvcPort := s.DefaultHTTPBackend()
+ ing := fmt.Sprintf(`
+apiVersion: networking.k8s.io/v1
+kind: Ingress
metadata:
- name: httpbin-route
+ name: httpbin-route
spec:
- http:
- - name: rule1
- match:
- hosts:
- - httpbin.com
+ ingressClassName: apisix
+ rules:
+ - host: httpbin.com
+ http:
paths:
- - /ip
- backends:
- - serviceName: %s
- servicePort: %d
+ - path: /ip
+ pathType: Exact
+ backend:
+ service:
+ name: %s
+ port:
+ number: %d
`, backendSvc, backendSvcPort[0])
- assert.Nil(ginkgo.GinkgoT(),
s.CreateVersionedApisixResource(apisixRoute))
- assert.Nil(ginkgo.GinkgoT(),
s.EnsureNumListUpstreamNodesNth(1, 1))
+ assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ing))
+ assert.Nil(ginkgo.GinkgoT(), s.EnsureNumListUpstreamNodesNth(1,
1))
- // port in nodes is still the targetPort, not the
service port
- ups, err := s.ListApisixUpstreams()
- assert.Nil(ginkgo.GinkgoT(), err, "listing APISIX
upstreams")
- assert.Equal(ginkgo.GinkgoT(), ups[0].Nodes[0].Port, 80)
+ // port in nodes is still the targetPort, not the service port
+ ups, err := s.ListApisixUpstreams()
+ assert.Nil(ginkgo.GinkgoT(), err, "listing APISIX upstreams")
+ assert.Equal(ginkgo.GinkgoT(), ups[0].Nodes[0].Port, 80)
- // scale HTTPBIN, so the endpoints controller has the
opportunity to update upstream.
- assert.Nil(ginkgo.GinkgoT(), s.ScaleHTTPBIN(3))
- assert.Nil(ginkgo.GinkgoT(),
s.EnsureNumListUpstreamNodesNth(1, 3))
+ // scale HTTPBIN, so the endpoints controller has the
opportunity to update upstream.
+ assert.Nil(ginkgo.GinkgoT(), s.ScaleHTTPBIN(3))
+ // s.ScaleHTTPBIN(3) process will be slow, and need time.
+ time.Sleep(10 * time.Second)
+ assert.Nil(ginkgo.GinkgoT(), s.EnsureNumListUpstreamNodesNth(1,
3))
- // port in nodes is still the targetPort, not the
service port
- ups, err = s.ListApisixUpstreams()
- assert.Nil(ginkgo.GinkgoT(), err, "listing APISIX
upstreams")
- assert.Equal(ginkgo.GinkgoT(), ups[0].Nodes[0].Port, 80)
- assert.Equal(ginkgo.GinkgoT(), ups[0].Nodes[1].Port, 80)
- assert.Equal(ginkgo.GinkgoT(), ups[0].Nodes[2].Port, 80)
- })
- }
- ginkgo.Describe("suite-endpoints: scaffold v2beta3", func() {
- suites(scaffold.NewScaffold(&scaffold.Options{
- Name: "endpoints-port",
- IngressAPISIXReplicas: 1,
- HTTPBinServicePort: 8080,
- ApisixResourceVersion:
scaffold.ApisixResourceVersion().V2beta3,
- }))
- })
- ginkgo.Describe("suite-endpoints: scaffold v2", func() {
- suites(scaffold.NewScaffold(&scaffold.Options{
- Name: "endpoints-port",
- IngressAPISIXReplicas: 1,
- HTTPBinServicePort: 8080,
- ApisixResourceVersion:
scaffold.ApisixResourceVersion().V2,
- }))
+ // port in nodes is still the targetPort, not the service port
+ ups, err = s.ListApisixUpstreams()
+ assert.Nil(ginkgo.GinkgoT(), err, "listing APISIX upstreams")
+ assert.Equal(ginkgo.GinkgoT(), ups[0].Nodes[0].Port, 80)
+ assert.Equal(ginkgo.GinkgoT(), ups[0].Nodes[1].Port, 80)
+ assert.Equal(ginkgo.GinkgoT(), ups[0].Nodes[2].Port, 80)
})
})
diff --git a/test/e2e/suite-config/manifests.go
b/test/e2e/suite-config/manifests.go
deleted file mode 100644
index 95712a7b..00000000
--- a/test/e2e/suite-config/manifests.go
+++ /dev/null
@@ -1,39 +0,0 @@
-// 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 config
-
-const (
- _ingressAPISIXConfigMapTemplate = `
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: ingress-apisix-controller-config
-data:
- config.yaml: |
- apisix:
- default_cluster_base_url: "{{.DEFAULT_CLUSTER_BASE_URL}}"
- default_cluster_admin_key: "{{.DEFAULT_CLUSTER_ADMIN_KEY}}"
- log_level: "debug"
- log_output: "stdout"
- http_listen: ":8080"
- https_listen: ":8443"
- enable_profiling: true
- kubernetes:
- namespace_selector:
- - %s
- apisix_route_version: "apisix.apache.org/v2beta3"
- watch_endpoint_slices: true
-`
-)
diff --git a/test/e2e/suite-features/websocket.go
b/test/e2e/suite-features/websocket.go
index e2402672..e7bc4a83 100644
--- a/test/e2e/suite-features/websocket.go
+++ b/test/e2e/suite-features/websocket.go
@@ -41,7 +41,7 @@ metadata:
spec:
containers:
- name: websocket-server
- image: localhost:5000/jmalloc/echo-server:latest
+ image: localhost:5000/jmalloc/echo-server:dev
ports:
- containerPort: 8080
---
diff --git a/test/e2e/suite-ingress/suite-ingress-features/resourcesync.go
b/test/e2e/suite-ingress/suite-ingress-features/resourcesync.go
index 7119c220..2fd4f304 100644
--- a/test/e2e/suite-ingress/suite-ingress-features/resourcesync.go
+++ b/test/e2e/suite-ingress/suite-ingress-features/resourcesync.go
@@ -139,6 +139,7 @@ spec:
waitTime := time.Until(readyTime).Seconds()
time.Sleep(time.Duration(waitTime) * time.Second)
+ time.Sleep(time.Second * 6)
_ = s.NewAPISIXClient().
GET("/ip").
@@ -196,6 +197,7 @@ spec:
waitTime := time.Until(readyTime).Seconds()
time.Sleep(time.Duration(waitTime) * time.Second)
+ time.Sleep(time.Second * 6)
_ = s.NewAPISIXClient().
GET("/ip").
diff --git a/test/e2e/suite-ingress/suite-ingress-resource/resourcepushing.go
b/test/e2e/suite-ingress/suite-ingress-resource/resourcepushing.go
index 88cd370b..62982fd5 100644
--- a/test/e2e/suite-ingress/suite-ingress-resource/resourcepushing.go
+++ b/test/e2e/suite-ingress/suite-ingress-resource/resourcepushing.go
@@ -17,6 +17,7 @@ package ingress
import (
"fmt"
"net/http"
+ "time"
ginkgo "github.com/onsi/ginkgo/v2"
"github.com/stretchr/testify/assert"
@@ -118,12 +119,8 @@ spec:
assert.Nil(ginkgo.GinkgoT(),
s.CreateVersionedApisixResource(apisixRoute))
- err = s.EnsureNumApisixRoutesCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
routes")
- err = s.EnsureNumApisixUpstreamsCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
upstreams")
- err = s.EnsureNumApisixPluginConfigCreated(0)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
pluginConfigs")
+ // EnsureNumApisixRoutesCreated cannot be used to
ensure update Correctness.
+ time.Sleep(6 * time.Second)
s.NewAPISIXClient().GET("/ip").WithHeader("Host",
"httpbin.com").Expect().Status(http.StatusNotFound)
s.NewAPISIXClient().GET("/ip").WithHeader("Host",
"httpbin.com").WithHeader("X-Foo", "barbaz").Expect().Status(http.StatusOK)
@@ -132,8 +129,6 @@ spec:
assert.Nil(ginkgo.GinkgoT(),
s.RemoveResourceByString(apisixRoute))
assert.Nil(ginkgo.GinkgoT(),
s.EnsureNumApisixRoutesCreated(0), "Checking number of routes")
- assert.Nil(ginkgo.GinkgoT(),
s.EnsureNumApisixUpstreamsCreated(0), "Checking number of upstreams")
- assert.Nil(ginkgo.GinkgoT(),
s.EnsureNumApisixPluginConfigCreated(0), "Checking number of pluginConfigs")
body :=
s.NewAPISIXClient().GET("/ip").WithHeader("Host",
"httpbin.com").Expect().Status(http.StatusNotFound).Body().Raw()
assert.Contains(ginkgo.GinkgoT(), body, "404 Route Not
Found")
@@ -196,12 +191,8 @@ spec:
assert.Nil(ginkgo.GinkgoT(),
s.CreateVersionedApisixResource(apisixRoute))
- err = s.EnsureNumApisixRoutesCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
routes")
- err = s.EnsureNumApisixUpstreamsCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
upstreams")
- err = s.EnsureNumApisixPluginConfigCreated(0)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
pluginConfigs")
+ // EnsureNumApisixRoutesCreated cannot be used to
ensure update Correctness.
+ time.Sleep(6 * time.Second)
s.NewAPISIXClient().GET("/ip").WithHeader("Host",
"httpbin.com").Expect().Status(http.StatusNotFound)
s.NewAPISIXClient().GET("/ip").WithHeader("Host",
"httpbin.com").WithHeader("X-Foo", "barbaz").Expect().Status(http.StatusOK)
@@ -209,10 +200,7 @@ spec:
// assert.Nil(ginkgo.GinkgoT(),
s.DeleteHTTPBINService())
// remove
assert.Nil(ginkgo.GinkgoT(),
s.RemoveResourceByString(apisixRoute))
-
assert.Nil(ginkgo.GinkgoT(),
s.EnsureNumApisixRoutesCreated(0), "Checking number of routes")
- assert.Nil(ginkgo.GinkgoT(),
s.EnsureNumApisixUpstreamsCreated(0), "Checking number of upstreams")
- assert.Nil(ginkgo.GinkgoT(),
s.EnsureNumApisixPluginConfigCreated(0), "Checking number of pluginConfigs")
body :=
s.NewAPISIXClient().GET("/ip").WithHeader("Host",
"httpbin.com").Expect().Status(http.StatusNotFound).Body().Raw()
assert.Contains(ginkgo.GinkgoT(), body, "404 Route Not
Found")
diff --git a/test/e2e/suite-plugins/suite-plugins-general/echo.go
b/test/e2e/suite-plugins/suite-plugins-general/echo.go
index 031a96b2..ad0b73a7 100644
--- a/test/e2e/suite-plugins/suite-plugins-general/echo.go
+++ b/test/e2e/suite-plugins/suite-plugins-general/echo.go
@@ -215,10 +215,8 @@ spec:
assert.Nil(ginkgo.GinkgoT(),
s.CreateVersionedApisixResource(ar))
- err = s.EnsureNumApisixUpstreamsCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
upstreams")
- err = s.EnsureNumApisixRoutesCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
routes")
+ // EnsureNumApisixRoutesCreated cannot be used to
ensure update Correctness.
+ time.Sleep(6 * time.Second)
resp =
s.NewAPISIXClient().GET("/ip").WithHeader("Host", "httpbin.org").Expect()
resp.Status(http.StatusOK)
diff --git a/test/e2e/suite-plugins/suite-plugins-general/redirect.go
b/test/e2e/suite-plugins/suite-plugins-general/redirect.go
index dbe25472..c8b2261f 100644
--- a/test/e2e/suite-plugins/suite-plugins-general/redirect.go
+++ b/test/e2e/suite-plugins/suite-plugins-general/redirect.go
@@ -201,10 +201,8 @@ spec:
assert.Nil(ginkgo.GinkgoT(),
s.CreateVersionedApisixResource(ar))
- err = s.EnsureNumApisixUpstreamsCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
upstreams")
- err = s.EnsureNumApisixRoutesCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
routes")
+ // EnsureNumApisixRoutesCreated cannot be used to
ensure update Correctness.
+ time.Sleep(6 * time.Second)
resp =
s.NewAPISIXClient().GET("/ip").WithHeader("Host", "httpbin.org").Expect()
resp.Status(http.StatusOK)
diff --git a/test/e2e/suite-plugins/suite-plugins-other/plugin_config.go
b/test/e2e/suite-plugins/suite-plugins-other/plugin_config.go
index e9642fa3..7d3c2967 100644
--- a/test/e2e/suite-plugins/suite-plugins-other/plugin_config.go
+++ b/test/e2e/suite-plugins/suite-plugins-other/plugin_config.go
@@ -456,7 +456,7 @@ spec:
ginkgo.It("enable plugin and then delete it", func() {
backendSvc, backendPorts := s.DefaultHTTPBackend()
- apc := fmt.Sprintf(`
+ apc := `
apiVersion: apisix.apache.org/v2beta3
kind: ApisixPluginConfig
metadata:
@@ -465,7 +465,7 @@ spec:
plugins:
- name: cors
enable: true
-`)
+`
assert.Nil(ginkgo.GinkgoT(),
s.CreateVersionedApisixResource(apc))
ar := fmt.Sprintf(`
apiVersion: apisix.apache.org/v2beta3
@@ -505,7 +505,7 @@ spec:
resp.Header("Access-Control-Max-Age").Equal("5")
resp.Body().Contains("origin")
- apc = fmt.Sprintf(`
+ apc = `
apiVersion: apisix.apache.org/v2beta3
kind: ApisixPluginConfig
metadata:
@@ -514,16 +514,12 @@ spec:
plugins:
- name: cors
enable: false
-`)
+`
assert.Nil(ginkgo.GinkgoT(),
s.CreateVersionedApisixResource(apc))
-
assert.Nil(ginkgo.GinkgoT(),
s.CreateVersionedApisixResource(ar))
- err = s.EnsureNumApisixUpstreamsCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
upstreams")
- err = s.EnsureNumApisixPluginConfigCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
pluginConfigs")
- err = s.EnsureNumApisixRoutesCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
routes")
+
+ // EnsureNumApisixRoutesCreated cannot be used to
ensure update Correctness.
+ time.Sleep(6 * time.Second)
resp =
s.NewAPISIXClient().GET("/ip").WithHeader("Host", "httpbin.org").Expect()
resp.Status(http.StatusOK)
diff --git a/test/e2e/suite-plugins/suite-plugins-security/cors.go
b/test/e2e/suite-plugins/suite-plugins-security/cors.go
index 43dfd865..b13bfbf6 100644
--- a/test/e2e/suite-plugins/suite-plugins-security/cors.go
+++ b/test/e2e/suite-plugins/suite-plugins-security/cors.go
@@ -17,6 +17,7 @@ package plugins
import (
"fmt"
"net/http"
+ "time"
ginkgo "github.com/onsi/ginkgo/v2"
"github.com/stretchr/testify/assert"
@@ -66,6 +67,7 @@ spec:
resp.Header("Access-Control-Max-Age").Equal("5")
resp.Body().Contains("origin")
})
+
ginkgo.It("finer granularity config", func() {
backendSvc, backendPorts := s.DefaultHTTPBackend()
ar := fmt.Sprintf(`
@@ -128,6 +130,7 @@ spec:
//
resp.Header("Access-Control-Allow-Credentials").Empty()
resp.Body().Contains("origin")
})
+
ginkgo.It("allow_origins_by_regex", func() {
ginkgo.Skip("APISIX version priors to 2.5 doesn't
contain allow_origins_by_regex in cors plugin")
backendSvc, backendPorts := s.DefaultHTTPBackend()
@@ -204,6 +207,7 @@ spec:
//
resp.Header("Access-Control-Allow-Credentials").Empty()
resp.Body().Contains("origin")
})
+
ginkgo.It("disable plugin", func() {
backendSvc, backendPorts := s.DefaultHTTPBackend()
ar := fmt.Sprintf(`
@@ -244,6 +248,7 @@ spec:
resp.Header("Access-Control-Max-Age").Empty()
resp.Body().Contains("origin")
})
+
ginkgo.It("enable plugin and then delete it", func() {
backendSvc, backendPorts := s.DefaultHTTPBackend()
ar := fmt.Sprintf(`
@@ -304,10 +309,9 @@ spec:
`, backendSvc, backendPorts[0])
assert.Nil(ginkgo.GinkgoT(),
s.CreateVersionedApisixResource(ar))
- err = s.EnsureNumApisixUpstreamsCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
upstreams")
- err = s.EnsureNumApisixRoutesCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
routes")
+
+ // EnsureNumApisixRoutesCreated cannot be used to
ensure update Correctness.
+ time.Sleep(6 * time.Second)
resp =
s.NewAPISIXClient().GET("/ip").WithHeader("Host", "httpbin.org").Expect()
resp.Status(http.StatusOK)
diff --git a/test/e2e/suite-plugins/suite-plugins-security/ip-restriction.go
b/test/e2e/suite-plugins/suite-plugins-security/ip-restriction.go
index 59544ce1..5d3f5e4d 100644
--- a/test/e2e/suite-plugins/suite-plugins-security/ip-restriction.go
+++ b/test/e2e/suite-plugins/suite-plugins-security/ip-restriction.go
@@ -16,6 +16,7 @@ package plugins
import (
"fmt"
+ "time"
ginkgo "github.com/onsi/ginkgo/v2"
"github.com/stretchr/testify/assert"
@@ -174,10 +175,8 @@ spec:
assert.Nil(ginkgo.GinkgoT(),
s.CreateVersionedApisixResource(ar))
- err = s.EnsureNumApisixUpstreamsCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
upstreams")
- err = s.EnsureNumApisixRoutesCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
routes")
+ // EnsureNumApisixRoutesCreated cannot be used to
ensure update Correctness.
+ time.Sleep(6 * time.Second)
// As we use port forwarding so the ip address is
127.0.0.1
s.NewAPISIXClient().GET("/ip").WithHeader("Host",
"httpbin.org").
diff --git a/test/e2e/suite-plugins/suite-plugins-security/uri_blocker.go
b/test/e2e/suite-plugins/suite-plugins-security/uri_blocker.go
index 71a5a80d..2056c2ed 100644
--- a/test/e2e/suite-plugins/suite-plugins-security/uri_blocker.go
+++ b/test/e2e/suite-plugins/suite-plugins-security/uri_blocker.go
@@ -216,10 +216,8 @@ spec:
assert.Nil(ginkgo.GinkgoT(),
s.CreateVersionedApisixResource(ar))
- err = s.EnsureNumApisixUpstreamsCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
upstreams")
- err = s.EnsureNumApisixRoutesCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
routes")
+ // EnsureNumApisixRoutesCreated cannot be used to
ensure update Correctness.
+ time.Sleep(6 * time.Second)
s.NewAPISIXClient().GET("/status/200").WithHeader("Host", "httpbin.org").
Expect().
diff --git a/test/e2e/suite-plugins/suite-plugins-traffic/limit_count.go
b/test/e2e/suite-plugins/suite-plugins-traffic/limit_count.go
index b7c01a38..06853d81 100644
--- a/test/e2e/suite-plugins/suite-plugins-traffic/limit_count.go
+++ b/test/e2e/suite-plugins/suite-plugins-traffic/limit_count.go
@@ -208,10 +208,8 @@ spec:
assert.Nil(ginkgo.GinkgoT(),
s.CreateVersionedApisixResource(ar))
- err = s.EnsureNumApisixUpstreamsCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
upstreams")
- err = s.EnsureNumApisixRoutesCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
routes")
+ // EnsureNumApisixRoutesCreated cannot be used to
ensure update Correctness.
+ time.Sleep(6 * time.Second)
s.NewAPISIXClient().GET("/ip").WithHeader("Host",
"httpbin.org").
Expect().
diff --git a/test/e2e/suite-plugins/suite-plugins-traffic/request_id.go
b/test/e2e/suite-plugins/suite-plugins-traffic/request_id.go
index d700e80f..ad1dcdf6 100644
--- a/test/e2e/suite-plugins/suite-plugins-traffic/request_id.go
+++ b/test/e2e/suite-plugins/suite-plugins-traffic/request_id.go
@@ -160,10 +160,8 @@ spec:
assert.Nil(ginkgo.GinkgoT(),
s.CreateVersionedApisixResource(ar))
- err = s.EnsureNumApisixUpstreamsCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
upstreams")
- err = s.EnsureNumApisixRoutesCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
routes")
+ // EnsureNumApisixRoutesCreated cannot be used to
ensure update Correctness.
+ time.Sleep(6 * time.Second)
resp =
s.NewAPISIXClient().GET("/ip").WithHeader("Host", "httpbin.org").Expect()
resp.Status(200)
diff --git
a/test/e2e/suite-plugins/suite-plugins-transformation/fault_injection.go
b/test/e2e/suite-plugins/suite-plugins-transformation/fault_injection.go
index 6d67762b..6e92a19a 100644
--- a/test/e2e/suite-plugins/suite-plugins-transformation/fault_injection.go
+++ b/test/e2e/suite-plugins/suite-plugins-transformation/fault_injection.go
@@ -224,10 +224,8 @@ spec:
assert.Nil(ginkgo.GinkgoT(),
s.CreateVersionedApisixResource(ar))
- err = s.EnsureNumApisixUpstreamsCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
upstreams")
- err = s.EnsureNumApisixRoutesCreated(1)
- assert.Nil(ginkgo.GinkgoT(), err, "Checking number of
routes")
+ // EnsureNumApisixRoutesCreated cannot be used to
ensure update Correctness.
+ time.Sleep(6 * time.Second)
resp = s.NewAPISIXClient().GET("/ip").WithQuery("name",
"bob").WithHeader("Host", "httpbin.org").Expect()
resp.Status(http.StatusOK)
diff --git a/utils/kind-with-registry.sh b/utils/kind-with-registry.sh
index 5792e92f..34b54bf8 100755
--- a/utils/kind-with-registry.sh
+++ b/utils/kind-with-registry.sh
@@ -62,7 +62,6 @@ nodes:
- role: control-plane
- role: worker
- role: worker
-- role: worker
containerdConfigPatches:
- |-
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:${reg_port}"]