diff --git a/.github/workflows/conformance-test.yml b/.github/workflows/conformance-test.yml index 54f5d6bfe..dc3f3a576 100644 --- a/.github/workflows/conformance-test.yml +++ b/.github/workflows/conformance-test.yml @@ -32,6 +32,12 @@ jobs: run: | go install sigs.k8s.io/kind@v0.23.0 + - 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 @@ -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: diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 982b23aae..e4e8aa522 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -32,6 +32,12 @@ jobs: run: | go install sigs.k8s.io/kind@v0.23.0 + - 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 @@ -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 diff --git a/.gitignore b/.gitignore index 170cd261e..7efa9bb91 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,5 @@ api7-ingress-controller-conformance-report.yaml *.mdx .cursor/ .env + +charts/api7ee3 diff --git a/Makefile b/Makefile index e65a3202b..79104dddc 100644 --- a/Makefile +++ b/Makefile @@ -106,6 +106,13 @@ 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)" +.PHONY: download-api7ee3-chart +download-api7ee3-chart: + @helm repo add api7 https://charts.api7.ai || true + @helm repo update + @helm pull api7/api7ee3 --destination "$(shell helm env HELM_REPOSITORY_CACHE)" + @echo "Downloaded API7EE3 chart" + .PHONY: conformance-test conformance-test: DASHBOARD_VERSION=$(DASHBOARD_VERSION) go test -v ./test/conformance -tags=conformance diff --git a/test/e2e/framework/dashboard.go b/test/e2e/framework/dashboard.go index 2d0cf22e7..a9285ec44 100644 --- a/test/e2e/framework/dashboard.go +++ b/test/e2e/framework/dashboard.go @@ -16,8 +16,8 @@ import ( "golang.org/x/net/html" "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" ) @@ -273,20 +273,16 @@ func (f *Framework) deploy() { ) f.GomegaT.Expect(err).ShouldNot(HaveOccurred(), "init helm action config") - chartPathOptions := action.ChartPathOptions{ - RepoURL: "https://charts.api7.ai", - } + install := action.NewInstall(actionConfig) + install.Namespace = f.kubectlOpts.Namespace + install.ReleaseName = "api7ee3" - chartPath, err := chartPathOptions.LocateChart("api7ee3", cli.New()) + chartPath, err := install.ChartPathOptions.LocateChart("api7/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") - install := action.NewInstall(actionConfig) - install.Namespace = f.kubectlOpts.Namespace - install.ReleaseName = "api7ee3" - buf := bytes.NewBuffer(nil) _ = valuesTemplate.Execute(buf, map[string]any{ "DB": _db,