Skip to content

Commit

Permalink
[issue-368] knative integration with DataIndex and JobService: update…
Browse files Browse the repository at this point in the history
… e2e test
  • Loading branch information
jianrongzhang89 committed Jul 19, 2024
1 parent bd167ca commit ff09b5f
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 13 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand 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
15 changes: 15 additions & 0 deletions hack/ci/create-kind-cluster-with-registry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@ reg_port='5001'
cat <<EOF | kind create cluster -n kind --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
system-reserved: memory=1Gi
- role: worker
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
system-reserved: memory=2Gi
containerdConfigPatches:
- |-
[plugins."io.containerd.grpc.v1.cri".registry]
Expand Down
19 changes: 19 additions & 0 deletions test/testdata/eventing.knative.dev_v1_broker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2024 Apache Software Foundation (ASF)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: eventing.knative.dev/v1
kind: Broker
metadata:
name: default
spec: {}
28 changes: 28 additions & 0 deletions test/testdata/knative_serving_eventing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: v1
kind: Namespace
metadata:
name: knative-serving
---
apiVersion: operator.knative.dev/v1beta1
kind: KnativeServing
metadata:
name: knative-serving
namespace: knative-serving
spec:
ingress:
kourier:
enabled: true
config:
network:
ingress-class: "kourier.ingress.networking.knative.dev"
---
apiVersion: v1
kind: Namespace
metadata:
name: knative-eventing
---
apiVersion: operator.knative.dev/v1beta1
kind: KnativeEventing
metadata:
name: knative-eventing
namespace: knative-eventing
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ kind: SonataFlowPlatform
metadata:
name: sonataflow-platform
spec:
eventing:
broker:
ref:
apiVersion: eventing.knative.dev/v1
kind: Broker
name: default
namespace: default
build:
config:
strategyOptions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ kind: SonataFlowPlatform
metadata:
name: sonataflow-platform
spec:
eventing:
broker:
ref:
apiVersion: eventing.knative.dev/v1
kind: Broker
name: default
namespace: default
persistence:
postgresql:
secretRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ kind: SonataFlowPlatform
metadata:
name: sonataflow-platform
spec:
eventing:
broker:
ref:
apiVersion: eventing.knative.dev/v1
kind: Broker
name: default
namespace: default
persistence:
postgresql:
secretRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ kind: SonataFlowPlatform
metadata:
name: sonataflow-platform
spec:
eventing:
broker:
ref:
apiVersion: eventing.knative.dev/v1
kind: Broker
name: default
namespace: default
persistence:
postgresql:
secretRef:
Expand Down

0 comments on commit ff09b5f

Please sign in to comment.