From f26288361101df79498568457e7b91e595751f81 Mon Sep 17 00:00:00 2001 From: Xunzhuo Date: Thu, 26 Jan 2023 15:31:59 +0800 Subject: [PATCH] chore: some clean-up to e2e tests (#143) Signed-off-by: bitliu --- .github/workflows/build-and-test.yml | 11 +++++------ Makefile.core.mk | 18 ++++++++++++++---- .../conformance/utils/kubernetes/apply.go | 3 --- test/ingress/conformance/utils/suite/suite.go | 3 --- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index ddc525fb3..a27ff67ce 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -43,7 +43,6 @@ jobs: with: go-version: 1.19 - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - name: "checkout ${{ github.ref }}" uses: actions/checkout@v3 with: @@ -58,13 +57,13 @@ jobs: name: higress path: out/ - conformance-test: + gateway-conformance-test: runs-on: ubuntu-latest needs: [build] steps: - uses: actions/checkout@v3 - e2e-test: + ingress-conformance-test: runs-on: ubuntu-latest needs: [build] steps: @@ -73,11 +72,11 @@ jobs: with: go-version: 1.19 - uses: actions/checkout@v3 - - name: "Run E2E Tests" - run: GOPROXY="https://proxy.golang.org,direct" make e2e-test + - name: "Run Ingress Conformance Tests" + run: GOPROXY="https://proxy.golang.org,direct" make ingress-conformance-test publish: runs-on: ubuntu-latest - needs: [conformance-test,e2e-test] + needs: [ingress-conformance-test,gateway-conformance-test] steps: - uses: actions/checkout@v3 diff --git a/Makefile.core.mk b/Makefile.core.mk index c34ffc19e..918f8d440 100644 --- a/Makefile.core.mk +++ b/Makefile.core.mk @@ -176,22 +176,32 @@ clean: clean-higress clean-gateway clean-istio clean-env clean-tool include tools/tools.mk include tools/lint.mk -.PHONY: e2e-test -e2e-test: $(tools/kind) delete-cluster create-cluster kube-load-image install-dev run-e2e-test delete-cluster +# gateway-conformance-test runs gateway api conformance tests. +.PHONY: gateway-conformance-test +gateway-conformance-test: +# ingress-conformance-test runs ingress api conformance tests. +.PHONY: ingress-conformance-test +ingress-conformance-test: $(tools/kind) delete-cluster create-cluster kube-load-image install-dev run-ingress-e2e-test delete-cluster + +# create-cluster creates a kube cluster with kind. +.PHONY: create-cluster create-cluster: $(tools/kind) tools/hack/create-cluster.sh +# delete-cluster deletes a kube cluster. .PHONY: delete-cluster delete-cluster: $(tools/kind) ## Delete kind cluster. $(tools/kind) delete cluster --name higress +# kube-load-image loads a local built docker image into kube cluster. .PHONY: kube-load-image kube-load-image: docker-build $(tools/kind) ## Install the EG image to a kind cluster using the provided $IMAGE and $TAG. tools/hack/kind-load-image.sh higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/higress $(TAG) -.PHONY: run-e2e-test -run-e2e-test: +# run-ingress-e2e-test starts to run ingress e2e tests. +.PHONY: run-ingress-e2e-test +run-ingress-e2e-test: @echo -e "\n\033[36mRunning higress conformance tests...\033[0m" @echo -e "\n\033[36mWaiting higress-controller to be ready...\033[0m\n" kubectl wait --timeout=5m -n higress-system deployment/higress-controller --for=condition=Available diff --git a/test/ingress/conformance/utils/kubernetes/apply.go b/test/ingress/conformance/utils/kubernetes/apply.go index 25a13fce0..5608e2c29 100644 --- a/test/ingress/conformance/utils/kubernetes/apply.go +++ b/test/ingress/conformance/utils/kubernetes/apply.go @@ -49,9 +49,6 @@ type Applier struct { // IngressClass will be used as the spec.gatewayClassName when applying Gateway resources IngressClass string - - // ControllerName will be used as the spec.controllerName when applying GatewayClass resources - ControllerName string } // prepareNamespace adjusts the Namespace labels. diff --git a/test/ingress/conformance/utils/suite/suite.go b/test/ingress/conformance/utils/suite/suite.go index a7d4eb157..6e4d78fd1 100644 --- a/test/ingress/conformance/utils/suite/suite.go +++ b/test/ingress/conformance/utils/suite/suite.go @@ -70,7 +70,6 @@ type ConformanceTestSuite struct { RoundTripper roundtripper.RoundTripper GatewayAddress string IngressClassName string - ControllerName string Debug bool Cleanup bool BaseManifests string @@ -150,10 +149,8 @@ func New(s Options) *ConformanceTestSuite { // in the cluster. It also ensures that all relevant resources are ready. func (suite *ConformanceTestSuite) Setup(t *testing.T) { t.Logf("Test Setup: Ensuring IngressClass has been accepted") - suite.ControllerName = suite.IngressClassName suite.Applier.IngressClass = suite.IngressClassName - suite.Applier.ControllerName = suite.ControllerName t.Logf("Test Setup: Applying base manifests") suite.Applier.MustApplyWithCleanup(t, suite.Client, suite.TimeoutConfig, suite.BaseManifests, suite.Cleanup)