Skip to content

Commit

Permalink
test ci
Browse files Browse the repository at this point in the history
  • Loading branch information
AlinsRan committed May 5, 2023
1 parent 395b256 commit 12ee095
Show file tree
Hide file tree
Showing 10 changed files with 230 additions and 219 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/e2e-test-ci.yml
Expand Up @@ -143,7 +143,7 @@ jobs:
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}

e2e-test:
e2e-test(admin-api):
needs:
- changes
- prepare
Expand All @@ -153,7 +153,6 @@ jobs:
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) }}
ingress-class-values: [ "apisix", "apisix-and-all" ]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion go.mod
@@ -1,6 +1,6 @@
module github.com/apache/apisix-ingress-controller

go 1.20
go 1.19

require (
github.com/api7/etcd-adapter v0.2.1
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/go.mod
Expand Up @@ -20,7 +20,7 @@ require (
require (
github.com/ajg/form v1.5.1 // indirect
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/api7/etcd-adapter v0.2.0 // indirect
github.com/api7/etcd-adapter v0.2.1 // indirect
github.com/api7/gopkg v0.1.2 // indirect
github.com/aws/aws-sdk-go v1.40.56 // indirect
github.com/beorn7/perks v1.0.1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/go.sum
Expand Up @@ -45,8 +45,8 @@ github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/api7/etcd-adapter v0.2.0 h1:6xs2KcHEi0roHvaHQjykbXeGZsE5ummUwd8xPnpkPRo=
github.com/api7/etcd-adapter v0.2.0/go.mod h1:jd6+/7G7AtNda5SZ8mFfuK1fJ6/1zuYPsr1/Y6ZqdUU=
github.com/api7/etcd-adapter v0.2.1 h1:3HPu8oo0QLFvij2ifcWL7PaSh8RFXFCvd97EMwm89+E=
github.com/api7/etcd-adapter v0.2.1/go.mod h1:jd6+/7G7AtNda5SZ8mFfuK1fJ6/1zuYPsr1/Y6ZqdUU=
github.com/api7/gopkg v0.1.2 h1:hldTbb3+iQE4LOxhV6ue/fVabsn9+QKnakOKCUS7Vss=
github.com/api7/gopkg v0.1.2/go.mod h1:O1Po3/R08p/ZQzYA6IOhvV1qiGlQEc16PBtL+KFewJ4=
github.com/api7/terratest v1.0.0 h1:Grg0xcvNpSRZa7QzjqfTPR3lfiHk13IdIBUrfUrDmw4=
Expand Down
4 changes: 3 additions & 1 deletion test/e2e/scaffold/scaffold.go
Expand Up @@ -171,7 +171,9 @@ func NewScaffold(o *Options) *Scaffold {
o.EnableEtcdServer = true

if o.APISIXConfigPath == "" {
if o.APISIXAdminAPIVersion == "v3" {
if o.EnableEtcdServer {
o.APISIXConfigPath = "testdata/apisix-gw-config-v3-grpc.yaml"
} else if o.APISIXAdminAPIVersion == "v3" {
o.APISIXConfigPath = "testdata/apisix-gw-config-v3.yaml"
} else {
o.APISIXConfigPath = "testdata/apisix-gw-config.yaml"
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/suite-features/external-sd.go
Expand Up @@ -211,6 +211,9 @@ spec:
opts.APISIXConfigPath = "testdata/apisix-gw-config-with-sd.yaml"
} else {
// default admin-api v3
if enabled := os.Getenv("ENABLED_ETCD_SERVER"); enabled == "true" {
opts.APISIXConfigPath = "testdata/apisix-gw-config-v3-with-sd-grpc.yaml"
}
opts.APISIXConfigPath = "testdata/apisix-gw-config-v3-with-sd.yaml"
}

Expand Down
51 changes: 51 additions & 0 deletions test/e2e/testdata/apisix-gw-config-v3-grpc.yaml
@@ -0,0 +1,51 @@
#
# 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.
#
# PLEASE DO NOT UPDATE THIS FILE!
# If you want to set the specified configuration value, you can set the new
# value in the conf/config.yaml file.
#

deployment:
admin:
allow_admin:
- 127.0.0.0/24
- 0.0.0.0/0
admin_listen:
ip: 0.0.0.0
port: 9180
etcd:
host:
- "http://{{ .EtcdServiceFQDN }}:2379"
prefix: "/apisix"
timeout: 30

apisix:
enable_control: true
enable_reuseport: true

stream_proxy:
only: false
tcp:
- 9100
- addr: 9110
tls: true
udp:
- 9200

plugin_attr:
prometheus:
enable_export_server: false
153 changes: 153 additions & 0 deletions test/e2e/testdata/apisix-gw-config-v3-with-sd-grpc.yaml
@@ -0,0 +1,153 @@
#
# 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.
#
# PLEASE DO NOT UPDATE THIS FILE!
# If you want to set the specified configuration value, you can set the new
# value in the conf/config.yaml file.
#

deployment:
admin:
allow_admin:
- 127.0.0.0/24
- 0.0.0.0/0
admin_listen:
ip: 0.0.0.0
port: 9180
etcd:
host:
- "http://{{ .EtcdServiceFQDN }}:2379"
prefix: "/apisix"
use_grpc: true
timeout: 3600

apisix:
enable_control: true
enable_reuseport: true

stream_proxy:
only: false
tcp:
- 9100
- addr: 9110
tls: true
udp:
- 9200

plugins: # plugin list (sorted by priority)
- real-ip # priority: 23000
- ai # priority: 22900
- client-control # priority: 22000
- proxy-control # priority: 21990
- request-id # priority: 12015
- zipkin # priority: 12011
#- skywalking # priority: 12010
#- opentelemetry # priority: 12009
- ext-plugin-pre-req # priority: 12000
- fault-injection # priority: 11000
- mocking # priority: 10900
- serverless-pre-function # priority: 10000
#- batch-requests # priority: 4010
- cors # priority: 4000
- ip-restriction # priority: 3000
- ua-restriction # priority: 2999
- referer-restriction # priority: 2990
- csrf # priority: 2980
- uri-blocker # priority: 2900
- request-validation # priority: 2800
- openid-connect # priority: 2599
- cas-auth # priority: 2597
- authz-casbin # priority: 2560
- authz-casdoor # priority: 2559
- wolf-rbac # priority: 2555
- ldap-auth # priority: 2540
- hmac-auth # priority: 2530
- basic-auth # priority: 2520
- jwt-auth # priority: 2510
- key-auth # priority: 2500
- consumer-restriction # priority: 2400
- forward-auth # priority: 2002
- opa # priority: 2001
- authz-keycloak # priority: 2000
#- error-log-logger # priority: 1091
- proxy-mirror # priority: 1010
- proxy-cache # priority: 1009
- proxy-rewrite # priority: 1008
- workflow # priority: 1006
- api-breaker # priority: 1005
- limit-conn # priority: 1003
- limit-count # priority: 1002
- limit-req # priority: 1001
#- node-status # priority: 1000
- gzip # priority: 995
- traffic-split # priority: 966
- redirect # priority: 900
- response-rewrite # priority: 899
- kafka-proxy # priority: 508
#- dubbo-proxy # priority: 507
- grpc-transcode # priority: 506
- grpc-web # priority: 505
- public-api # priority: 501
- prometheus # priority: 500
- datadog # priority: 495
- elasticsearch-logger # priority: 413
- echo # priority: 412
- loggly # priority: 411
- http-logger # priority: 410
- splunk-hec-logging # priority: 409
- skywalking-logger # priority: 408
- google-cloud-logging # priority: 407
- sls-logger # priority: 406
- tcp-logger # priority: 405
- kafka-logger # priority: 403
- rocketmq-logger # priority: 402
- syslog # priority: 401
- udp-logger # priority: 400
- file-logger # priority: 399
- clickhouse-logger # priority: 398
- tencent-cloud-cls # priority: 397
- inspect # priority: 200
#- log-rotate # priority: 100
# <- recommend to use priority (0, 100) for your custom plugins
- example-plugin # priority: 0
#- gm # priority: -43
- aws-lambda # priority: -1899
- azure-functions # priority: -1900
- openwhisk # priority: -1901
- openfunction # priority: -1902
- serverless-post-function # priority: -2000
- ext-plugin-post-req # priority: -3000
- ext-plugin-post-resp # priority: -4000


plugin_attr:
prometheus:
enable_export_server: false

discovery:
dns:
servers:
- "10.96.0.10:53" # use the real address of your dns server.
# currently we use KIND as the standard test environment, so here we can hard-code the default DNS address first.
# TODO: can be modified to fill dynamically

nginx_config: # config for render the template to generate nginx.conf
#user: root # specifies the execution user of the worker process.
# the "user" directive makes sense only if the master process runs with super-user privileges.
# if you're not root user,the default is current user.
error_log: logs/error.log
error_log_level: debug # warn,error
worker_processes: 1

0 comments on commit 12ee095

Please sign in to comment.