From ff09b5f61477a8465600663777c977e19efb06f4 Mon Sep 17 00:00:00 2001 From: jianrongzhang89 Date: Thu, 18 Jul 2024 14:17:55 -0400 Subject: [PATCH] [issue-368] knative integration with DataIndex and JobService: update e2e test --- .github/workflows/e2e.yml | 2 +- Makefile | 25 +++++++++-------- hack/ci/create-kind-cluster-with-registry.sh | 15 ++++++++++ .../eventing.knative.dev_v1_broker.yaml | 19 +++++++++++++ test/testdata/knative_serving_eventing.yaml | 28 +++++++++++++++++++ .../by_service/02-sonataflow_platform.yaml | 7 +++++ .../02-sonataflow_platform.yaml | 7 +++++ .../02-sonataflow_platform.yaml | 7 +++++ .../02-sonataflow_platform.yaml | 7 +++++ 9 files changed, 104 insertions(+), 13 deletions(-) create mode 100644 test/testdata/eventing.knative.dev_v1_broker.yaml create mode 100644 test/testdata/knative_serving_eventing.yaml diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 6e7c84c52..d126fecc6 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -61,7 +61,7 @@ jobs: cekit --version - name: Setup Kind cluster - run: make KIND_VERSION=${{ env.KIND_VERSION }} create-cluster + run: make KIND_VERSION=${{ env.KIND_VERSION }} BUILDER=docker create-cluster - name: Deploy Knative Eventing and Serving run: make KNATIVE_VERSION=${{ env.KNATIVE_VERSION }} deploy-knative diff --git a/Makefile b/Makefile index c2e22d109..233c1d866 100644 --- a/Makefile +++ b/Makefile @@ -341,8 +341,8 @@ addheaders: generate-all: generate generate-deploy bundle addheaders vet fmt .PHONY: test-e2e # You will need to have a Minikube/Kind cluster up in running to run this target, and run container-builder before the test -test-e2e: - go test ./test/e2e/* -v -ginkgo.v -ginkgo.no-color -ginkgo.junit-report=./e2e-test-report.xml -timeout 60m +test-e2e: deploy-broker + go test ./test/e2e/* -v -ginkgo.v -ginkgo.no-color -ginkgo.junit-report=./e2e-test-report.xml -timeout $(TIMEOUT_SECS) .PHONY: before-pr before-pr: test generate-all @@ -358,17 +358,18 @@ create-cluster: install-kind .PHONY: deploy-knative deploy-knative: create-cluster - kubectl apply -f $(KNATIVE_SERVING_PREFIX)/serving-crds.yaml - kubectl apply -f $(KNATIVE_SERVING_PREFIX)/serving-core.yaml - kubectl apply -f $(KNATIVE_EVENTING_PREFIX)/eventing-crds.yaml - kubectl apply -f $(KNATIVE_EVENTING_PREFIX)/eventing-core.yaml - kubectl wait --for=condition=Available=True deploy/eventing-controller -n knative-eventing --timeout=$(TIMEOUT_SECS) - kubectl wait --for=condition=Available=True deploy/eventing-webhook -n knative-eventing --timeout=$(TIMEOUT_SECS) - kubectl wait --for=condition=Available=True deploy/controller -n knative-serving --timeout=$(TIMEOUT_SECS) - kubectl wait --for=condition=Available=True deploy/webhook -n knative-serving --timeout=$(TIMEOUT_SECS) - kubectl wait --for=condition=Available=True deploy/autoscaler -n knative-serving --timeout=$(TIMEOUT_SECS) - kubectl wait --for=condition=Available=True deploy/activator -n knative-serving --timeout=$(TIMEOUT_SECS) + kubectl apply -f https://github.com/knative/operator/releases/download/knative-$(KNATIVE_VERSION)/operator.yaml + kubectl wait --for=condition=Available=True deploy/knative-operator -n default --timeout=$(TIMEOUT_SECS) + kubectl apply -f ./test/testdata/knative_serving_eventing.yaml + kubectl wait --for=condition=Ready=True KnativeServing/knative-serving -n knative-serving --timeout=$(TIMEOUT_SECS) + kubectl wait --for=condition=Ready=True KnativeEventing/knative-eventing -n knative-eventing --timeout=$(TIMEOUT_SECS) +# deploy a default broker for e2e test +.PHONY: deploy-brokermake +deploy-broker: + kubectl apply -f ./test/testdata/eventing.knative.dev_v1_broker.yaml -n default + kubectl wait --for=condition=Ready=True broker.eventing.knative.dev/default -n default --timeout=$(TIMEOUT_SECS) + .PHONY: delete-cluster delete-cluster: install-kind kind delete cluster && $(BUILDER) rm -f kind-registry \ No newline at end of file diff --git a/hack/ci/create-kind-cluster-with-registry.sh b/hack/ci/create-kind-cluster-with-registry.sh index f7ab44bec..4cded1a9a 100755 --- a/hack/ci/create-kind-cluster-with-registry.sh +++ b/hack/ci/create-kind-cluster-with-registry.sh @@ -32,6 +32,21 @@ reg_port='5001' cat <