chore: some clean-up to e2e tests (#143)

Signed-off-by: bitliu <bitliu@tencent.com>
This commit is contained in:
Xunzhuo
2023-01-26 15:31:59 +08:00
committed by GitHub
parent 4fb9efe3bf
commit f262883611
4 changed files with 19 additions and 16 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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)