Skip to content

Commit 3fa0bc6

Browse files
committed
chore(ci): add helm download
Signed-off-by: ashing <[email protected]>
1 parent c55673a commit 3fa0bc6

File tree

5 files changed

+39
-8
lines changed

5 files changed

+39
-8
lines changed

.github/workflows/conformance-test.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ jobs:
3232
run: |
3333
go install sigs.k8s.io/[email protected]
3434
35+
- name: Install Helm
36+
run: |
37+
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
38+
chmod 700 get_helm.sh
39+
./get_helm.sh
40+
3541
conformance-test:
3642
needs:
3743
- prepare
@@ -81,6 +87,10 @@ jobs:
8187
run: |
8288
make kind-load-images
8389
90+
- name: Install API7EE3
91+
run: |
92+
make download-api7ee3-chart
93+
8494
- name: Run Conformance Test
8595
shell: bash
8696
env:

.github/workflows/e2e-test.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ jobs:
3232
run: |
3333
go install sigs.k8s.io/[email protected]
3434
35+
- name: Install Helm
36+
run: |
37+
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
38+
chmod 700 get_helm.sh
39+
./get_helm.sh
40+
3541
e2e-test:
3642
needs:
3743
- prepare
@@ -72,6 +78,10 @@ jobs:
7278
run: |
7379
make install
7480
81+
- name: Download API7EE3 Chart
82+
run: |
83+
make download-api7ee3-chart
84+
7585
- name: Loading Docker Image to Kind Cluster
7686
run: |
7787
make kind-load-images

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@ api7-ingress-controller-conformance-report.yaml
3434
*.mdx
3535
.cursor/
3636

37+
charts/api7ee3
38+

Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ GATEAY_API_VERSION ?= v1.2.0
1414

1515
DASHBOARD_VERSION ?= dev
1616
TEST_TIMEOUT ?= 45m
17+
CHART_DIR ?= $(shell pwd)/charts
18+
API7EE3_CHART_DIR ?= $(CHART_DIR)/api7ee3
1719

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

@@ -104,11 +106,20 @@ kind-e2e-test: kind-up build-image kind-load-images e2e-test
104106
.PHONY: e2e-test
105107
e2e-test:
106108
@kind get kubeconfig --name $(KIND_NAME) > $$KUBECONFIG
107-
DASHBOARD_VERSION=$(DASHBOARD_VERSION) go test ./test/e2e/ -test.timeout=$(TEST_TIMEOUT) -v -ginkgo.v -ginkgo.focus="$(TEST_FOCUS)"
109+
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)"
110+
111+
.PHONY: download-api7ee3-chart
112+
download-api7ee3-chart:
113+
@mkdir -p $(CHART_DIR)
114+
@rm -rf $(API7EE3_CHART_DIR) || true
115+
@helm repo add api7 https://charts.api7.ai || true
116+
@helm repo update
117+
@helm pull api7/api7ee3 --untar --untardir $(CHART_DIR)
118+
@echo "Downloaded API7EE3 chart to $(API7EE3_CHART_DIR)"
108119

109120
.PHONY: conformance-test
110121
conformance-test:
111-
DASHBOARD_VERSION=$(DASHBOARD_VERSION) go test -v ./test/conformance -tags=conformance
122+
DASHBOARD_VERSION=$(DASHBOARD_VERSION) API7EE3_CHART_DIR=$(API7EE3_CHART_DIR) go test -v ./test/conformance -tags=conformance
112123

113124
.PHONY: lint
114125
lint: golangci-lint ## Run golangci-lint linter

test/e2e/framework/dashboard.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"helm.sh/helm/v3/pkg/action"
1818
"helm.sh/helm/v3/pkg/chart/loader"
1919

20-
"helm.sh/helm/v3/pkg/cli"
2120
"helm.sh/helm/v3/pkg/kube"
2221
"k8s.io/apimachinery/pkg/util/yaml"
2322
)
@@ -273,13 +272,11 @@ func (f *Framework) deploy() {
273272
)
274273
f.GomegaT.Expect(err).ShouldNot(HaveOccurred(), "init helm action config")
275274

276-
chartPathOptions := action.ChartPathOptions{
277-
RepoURL: "https://charts.api7.ai",
275+
chartPath := os.Getenv("API7EE3_CHART_DIR")
276+
if chartPath == "" {
277+
panic("env {API7EE3_CHART_DIR} is required")
278278
}
279279

280-
chartPath, err := chartPathOptions.LocateChart("api7ee3", cli.New())
281-
f.GomegaT.Expect(err).ShouldNot(HaveOccurred(), "locate helm chart")
282-
283280
chart, err := loader.Load(chartPath)
284281
f.GomegaT.Expect(err).ShouldNot(HaveOccurred(), "load helm chart")
285282

@@ -367,6 +364,7 @@ func (f *Framework) GetDataplaneCertificates(gatewayGroupID string) *v1.Dataplan
367364
POST("/api/gateway_groups/"+gatewayGroupID+"/dp_client_certificates").
368365
WithBasicAuth("admin", "admin").
369366
WithHeader("Content-Type", "application/json").
367+
WithBytes([]byte(`{}`)).
370368
Expect()
371369

372370
f.Logger.Logf(f.GinkgoT, "dataplane certificates issuer response: %s", respExp.Body().Raw())

0 commit comments

Comments
 (0)