Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions .github/workflows/benchmark-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# 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: Benchmark Test

on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
inputs:
routes:
description: "Number of routes for benchmark test"
required: false
default: "2000"
consumers:
description: "Number of consumers for benchmark test"
required: false
default: "2000"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
ADC_VERSION: dev
BENCHMARK_ROUTES: ${{ github.event.inputs.routes }}
BENCHMARK_CONSUMERS: ${{ github.event.inputs.consumers }}

jobs:
e2e-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Go Env
uses: actions/setup-go@v4
with:
go-version: "1.24"

- name: Install kind
run: |
go install sigs.k8s.io/kind@v0.23.0

- name: Install ginkgo
run: |
make install-ginkgo

- name: Install Helm
run: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh

- name: Login to Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to Private Registry
uses: docker/login-action@v3
with:
registry: hkccr.ccs.tencentyun.com
username: ${{ secrets.PRIVATE_DOCKER_USERNAME }}
password: ${{ secrets.PRIVATE_DOCKER_PASSWORD }}

- name: Build images
env:
TAG: dev
ARCH: amd64
ENABLE_PROXY: "false"
BASE_IMAGE_TAG: "debug"
run: |
echo "building images..."
make build-image

- name: Launch Kind Cluster
run: |
make kind-up

- name: Loading Docker Image to Kind Cluster
run: |
make kind-load-images

- name: Download API7EE3 Chart
run: |
make download-api7ee3-chart

- name: Install Gateway API And CRDs
run: |
make install

- name: Run Benchmark Test
shell: bash
env:
API7_EE_LICENSE: ${{ secrets.API7_EE_LICENSE }}
PROVIDER_TYPE: api7ee
TEST_ENV: CI
run: |
make benchmark-test
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ CONFORMANCE_TEST_REPORT_OUTPUT ?= $(DIR)/apisix-ingress-controller-conformance-r
## https://github.com/kubernetes-sigs/gateway-api/blob/v1.3.0/conformance/utils/suite/profiles.go
CONFORMANCE_PROFILES ?= GATEWAY-HTTP,GATEWAY-GRPC,GATEWAY-TLS

TEST_EXCLUDES ?= /e2e /conformance /benchmark
TEST_PACKAGES = $(shell go list ./... $(foreach p,$(TEST_EXCLUDES),| grep -v $(p)))

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
Expand Down Expand Up @@ -135,7 +138,7 @@ vet: ## Run go vet against code.

.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e | grep -v /conformance) -coverprofile cover.out
KUBEBUILDER_ASSETS="$$( $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path )" go test $(TEST_PACKAGES) -coverprofile cover.out

.PHONY: kind-e2e-test
kind-e2e-test: kind-up build-image kind-load-images e2e-test
Expand Down Expand Up @@ -176,6 +179,10 @@ conformance-test-api7ee:
--conformance-profiles=$(CONFORMANCE_PROFILES) \
--report-output=$(CONFORMANCE_TEST_REPORT_OUTPUT)

.PHONY: benchmark-test
benchmark-test:
go test -v ./test/benchmark -test.timeout=$(TEST_TIMEOUT) -v -ginkgo.v

.PHONY: lint
lint: sort-import golangci-lint ## Run golangci-lint linter
$(GOLANGCI_LINT) run
Expand Down
15 changes: 10 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ require (
github.com/hashicorp/go-memdb v1.3.4
github.com/imdario/mergo v0.3.16
github.com/incubator4/go-resty-expr v0.1.1
github.com/olekukonko/tablewriter v1.1.1
github.com/onsi/ginkgo/v2 v2.22.0
github.com/onsi/gomega v1.36.1
github.com/pkg/errors v0.9.1
Expand Down Expand Up @@ -99,7 +100,10 @@ require (
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/chai2010/gettext-go v1.0.2 // indirect
github.com/containerd/containerd v1.7.15 // indirect
github.com/clipperhouse/displaywidth v0.3.1 // indirect
github.com/clipperhouse/stringish v0.1.1 // indirect
github.com/clipperhouse/uax29/v2 v2.2.0 // indirect
github.com/containerd/containerd v1.7.12 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
Expand Down Expand Up @@ -168,8 +172,7 @@ require (
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mattn/go-sqlite3 v1.14.19 // indirect
github.com/mattn/go-runewidth v0.0.19 // indirect
github.com/mattn/go-zglob v0.0.2-0.20190814121620-e3c945676326 // indirect
github.com/miekg/dns v1.1.65 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
Expand All @@ -184,15 +187,17 @@ require (
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6 // indirect
github.com/olekukonko/errors v1.1.0 // indirect
github.com/olekukonko/ll v0.1.2 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc6 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/pquerna/otp v1.4.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rubenv/sql-migrate v1.5.2 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sanity-io/litter v1.5.5 // indirect
Expand Down
Loading
Loading