Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
10 changes: 10 additions & 0 deletions .github/workflows/conformance-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ jobs:
run: |
go install sigs.k8s.io/[email protected]

- 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

conformance-test:
needs:
- prepare
Expand Down Expand Up @@ -81,6 +87,10 @@ jobs:
run: |
make kind-load-images

- name: Install API7EE3
run: |
make download-api7ee3-chart

- name: Run Conformance Test
shell: bash
env:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ jobs:
run: |
go install sigs.k8s.io/[email protected]

- 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

e2e-test:
needs:
- prepare
Expand Down Expand Up @@ -72,6 +78,10 @@ jobs:
run: |
make install

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

- name: Loading Docker Image to Kind Cluster
run: |
make kind-load-images
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ api7-ingress-controller-conformance-report.yaml
*.mdx
.cursor/
.env

charts/api7ee3
15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ GATEAY_API_VERSION ?= v1.2.0

DASHBOARD_VERSION ?= dev
TEST_TIMEOUT ?= 45m
CHART_DIR ?= $(shell pwd)/charts
API7EE3_CHART_DIR ?= $(CHART_DIR)/api7ee3

export KUBECONFIG = /tmp/$(KIND_NAME).kubeconfig

Expand Down Expand Up @@ -104,11 +106,20 @@ kind-e2e-test: kind-up build-image kind-load-images e2e-test
.PHONY: e2e-test
e2e-test:
@kind get kubeconfig --name $(KIND_NAME) > $$KUBECONFIG
DASHBOARD_VERSION=$(DASHBOARD_VERSION) go test ./test/e2e/ -test.timeout=$(TEST_TIMEOUT) -v -ginkgo.v -ginkgo.focus="$(TEST_FOCUS)"
DASHBOARD_VERSION=$(DASHBOARD_VERSION) API7EE3_CHART_DIR=$(API7EE3_CHART_DIR) go test ./test/e2e/ -test.timeout=$(TEST_TIMEOUT) -v -ginkgo.v -ginkgo.focus="$(TEST_FOCUS)"

.PHONY: download-api7ee3-chart
download-api7ee3-chart:
@mkdir -p $(CHART_DIR)
@rm -rf $(API7EE3_CHART_DIR) || true
@helm repo add api7 https://charts.api7.ai || true
@helm repo update
@helm pull api7/api7ee3 --untar --untardir $(CHART_DIR)
@echo "Downloaded API7EE3 chart to $(API7EE3_CHART_DIR)"

.PHONY: conformance-test
conformance-test:
DASHBOARD_VERSION=$(DASHBOARD_VERSION) go test -v ./test/conformance -tags=conformance
DASHBOARD_VERSION=$(DASHBOARD_VERSION) API7EE3_CHART_DIR=$(API7EE3_CHART_DIR) go test -v ./test/conformance -tags=conformance

.PHONY: lint
lint: golangci-lint ## Run golangci-lint linter
Expand Down
9 changes: 3 additions & 6 deletions test/e2e/framework/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"helm.sh/helm/v3/pkg/action"
"helm.sh/helm/v3/pkg/chart/loader"

"helm.sh/helm/v3/pkg/cli"
"helm.sh/helm/v3/pkg/kube"
"k8s.io/apimachinery/pkg/util/yaml"
)
Expand Down Expand Up @@ -273,13 +272,11 @@ func (f *Framework) deploy() {
)
f.GomegaT.Expect(err).ShouldNot(HaveOccurred(), "init helm action config")

chartPathOptions := action.ChartPathOptions{
RepoURL: "https://charts.api7.ai",
chartPath := os.Getenv("API7EE3_CHART_DIR")
if chartPath == "" {
panic("env {API7EE3_CHART_DIR} is required")
}

chartPath, err := chartPathOptions.LocateChart("api7ee3", cli.New())
f.GomegaT.Expect(err).ShouldNot(HaveOccurred(), "locate helm chart")

chart, err := loader.Load(chartPath)
f.GomegaT.Expect(err).ShouldNot(HaveOccurred(), "load helm chart")

Expand Down
Loading