Skip to content

Commit 27f6faf

Browse files
authored
test: support apisix standalone (part 1) (#156)
Signed-off-by: ashing <[email protected]>
1 parent 75ae919 commit 27f6faf

34 files changed

+1521
-1639
lines changed

.github/workflows/apisix-e2e-test.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: APISIX E2E Test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- release-v2-dev
8+
pull_request:
9+
branches:
10+
- master
11+
- release-v2-dev
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
prepare:
19+
name: Prepare
20+
runs-on: buildjet-2vcpu-ubuntu-2204
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Go Env
26+
id: go
27+
uses: actions/setup-go@v4
28+
with:
29+
go-version: "1.22"
30+
31+
- name: Install kind
32+
run: |
33+
go install sigs.k8s.io/[email protected]
34+
35+
e2e-test:
36+
needs:
37+
- prepare
38+
runs-on: buildjet-2vcpu-ubuntu-2204
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
with:
43+
submodules: recursive
44+
45+
- name: Setup Go Env
46+
uses: actions/setup-go@v4
47+
with:
48+
go-version: "1.22"
49+
50+
- name: Build images
51+
env:
52+
TAG: dev
53+
ARCH: amd64
54+
ENABLE_PROXY: "false"
55+
BASE_IMAGE_TAG: "debug"
56+
run: |
57+
echo "building images..."
58+
make build-image
59+
60+
- name: Launch Kind Cluster
61+
run: |
62+
make kind-up
63+
64+
- name: Install Gateway API And CRDs
65+
run: |
66+
make install
67+
68+
- name: Run E2E test suite
69+
shell: bash
70+
run: |
71+
make e2e-test-standalone

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ e2e-test:
111111
@kind get kubeconfig --name $(KIND_NAME) > $$KUBECONFIG
112112
DASHBOARD_VERSION=$(DASHBOARD_VERSION) go test ./test/e2e/ -test.timeout=$(TEST_TIMEOUT) -v -ginkgo.v -ginkgo.focus="$(TEST_FOCUS)"
113113

114+
.PHONY: e2e-test-standalone
115+
e2e-test-standalone:
116+
@kind get kubeconfig --name $(KIND_NAME) > $$KUBECONFIG
117+
go test ./test/e2e/apisix/ -test.timeout=$(TEST_TIMEOUT) -v -ginkgo.v -ginkgo.focus="$(TEST_FOCUS)"
118+
114119
.PHONY: download-api7ee3-chart
115120
download-api7ee3-chart:
116121
@helm repo add api7 https://charts.api7.ai || true

cmd/root/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
// to ensure that exec-entrypoint and run can make use of them.
2121

2222
"go.uber.org/zap/zapcore"
23-
"gopkg.in/yaml.v2"
23+
"gopkg.in/yaml.v3"
2424
_ "k8s.io/client-go/plugin/pkg/client/auth"
2525

2626
"github.com/go-logr/zapr"

go.mod

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ toolchain go1.22.5
77
require (
88
github.com/Masterminds/sprig/v3 v3.2.3
99
github.com/api7/gopkg v0.2.1-0.20230601092738-0f3730f9b57a
10-
github.com/gavv/httpexpect v2.0.0+incompatible
1110
github.com/gavv/httpexpect/v2 v2.16.0
1211
github.com/go-logr/logr v1.4.2
1312
github.com/go-logr/zapr v1.3.0
@@ -28,13 +27,13 @@ require (
2827
go.uber.org/zap v1.27.0
2928
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
3029
golang.org/x/net v0.28.0
31-
gopkg.in/yaml.v2 v2.4.0
32-
gorm.io/gorm v1.25.11
30+
gopkg.in/yaml.v3 v3.0.1
3331
helm.sh/helm/v3 v3.15.4
3432
k8s.io/api v0.31.1
3533
k8s.io/apiextensions-apiserver v0.31.1
3634
k8s.io/apimachinery v0.31.1
3735
k8s.io/client-go v0.31.1
36+
k8s.io/kubectl v0.30.3
3837
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
3938
sigs.k8s.io/controller-runtime v0.19.0
4039
sigs.k8s.io/gateway-api v1.2.0
@@ -80,7 +79,6 @@ require (
8079
github.com/evanphx/json-patch v5.9.0+incompatible // indirect
8180
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
8281
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect
83-
github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072 // indirect
8482
github.com/fatih/color v1.17.0 // indirect
8583
github.com/fatih/structs v1.1.0 // indirect
8684
github.com/felixge/httpsnoop v1.0.4 // indirect
@@ -121,8 +119,6 @@ require (
121119
github.com/imdario/mergo v0.3.16 // indirect
122120
github.com/imkira/go-interpol v1.1.0 // indirect
123121
github.com/inconshreveable/mousetrap v1.1.0 // indirect
124-
github.com/jinzhu/inflection v1.0.0 // indirect
125-
github.com/jinzhu/now v1.1.5 // indirect
126122
github.com/jmespath/go-jmespath v0.4.0 // indirect
127123
github.com/jmoiron/sqlx v1.3.5 // indirect
128124
github.com/josharian/intern v1.0.0 // indirect
@@ -149,7 +145,6 @@ require (
149145
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
150146
github.com/modern-go/reflect2 v1.0.2 // indirect
151147
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
152-
github.com/moul/http2curl v1.0.0 // indirect
153148
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
154149
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
155150
github.com/opencontainers/go-digest v1.0.0 // indirect
@@ -211,13 +206,12 @@ require (
211206
gopkg.in/fsnotify.v1 v1.4.7 // indirect
212207
gopkg.in/inf.v0 v0.9.1 // indirect
213208
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
214-
gopkg.in/yaml.v3 v3.0.1 // indirect
209+
gopkg.in/yaml.v2 v2.4.0 // indirect
215210
k8s.io/apiserver v0.31.1 // indirect
216211
k8s.io/cli-runtime v0.30.3 // indirect
217212
k8s.io/component-base v0.31.1 // indirect
218213
k8s.io/klog/v2 v2.130.1 // indirect
219214
k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f // indirect
220-
k8s.io/kubectl v0.30.3 // indirect
221215
moul.io/http2curl/v2 v2.3.0 // indirect
222216
oras.land/oras-go v1.2.5 // indirect
223217
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect

0 commit comments

Comments
 (0)