-
Notifications
You must be signed in to change notification settings - Fork 16
135 lines (119 loc) · 4.56 KB
/
e2e_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Copyright 2024 StreamNative
#
# 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.
name: Operator E2e tests
on:
pull_request:
branches:
- '*'
paths:
- '**.go'
- '.github/workflows/e2e_test.yml'
env:
GOPRIVATE: github.com/streamnative
jobs:
e2e-test:
name: E2e tests for Operators
strategy:
matrix:
alwaysUpdatePulsar: [ "true", "false" ]
runs-on: ubuntu-latest
env:
ALWAYS_UPDATE_PULSAR_RESOURCE: ${{ matrix.alwaysUpdatePulsar }}
GOPRIVATE: github.com/streamnative
ACCESS_TOKEN: ${{ secrets.SNBOT_GITHUB_TOKEN }}
IMAGE: streamnative/sn-platform:2.10.4.3
WATCH_CERT_MANAGER_CRDS: "false"
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/[email protected]
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Cleanup disk
run: sudo rm -rf /usr/local/.ghcup
- name: Set up Go 1.22.11
uses: actions/setup-go@v3
with:
go-version: '1.22.11'
id: go
- name: Set up Git token
run: |
git config --global url."https://${ACCESS_TOKEN}:@github.com/".insteadOf "https://github.com/"
- name: Login to DockerHub
uses: docker/login-action@v2
with:
registry: docker.io
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Ginkgo
run: |
go install github.com/onsi/ginkgo/ginkgo@latest
- name: Checkout
uses: actions/checkout@v3
# TODO the k8s version should be configurable
- name: Setup K8s cluster
run: |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.23.0/kind-linux-amd64
chmod +x ./kind
export PATH="$PWD:$PATH"
kind version
./hack/kind-cluster-build.sh --nodeNum 1 --k8sVersion v1.22.17
- name: Initialize K8s cluster
run: |
docker pull "$IMAGE"
kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$IMAGE"
docker pull docker.cloudsmith.io/streamnative/operators/kubebuilder/kube-rbac-proxy:v0.8.0
kind load docker-image --name pulsar-dev docker.cloudsmith.io/streamnative/operators/kubebuilder/kube-rbac-proxy:v0.8.0
df -h
- name: Install Pulsar Operators and sn-platform
run: |
helm repo add streamnative https://charts.streamnative.io
helm repo add jetstack https://charts.jetstack.io
helm repo update
helm install cert-manager jetstack/cert-manager --set installCRDs=true --version v1.8.2
rm -rf pulsar-charts/
git clone --branch pulsar-operator-0.17.10 https://github.com/streamnative/charts.git pulsar-charts
cd pulsar-charts/
./scripts/pulsar/prepare_helm_release.sh -n default -k test -c
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update
helm dependency update charts/pulsar
helm install test --set initialize=true --values ../.ci/clusters/values.yaml charts/pulsar
df -h
- name: Build and Setup Pulsar Resources Operator
run: |
make docker-build
kind load docker-image --name pulsar-dev controller:latest
make deploy
kubectl get crds
kubectl wait --for condition=available --timeout=360s deployment/pulsar-resources-operator-controller-manager -npulsar-resources-operator-system
df -h
- name: Run Operator Test
run: |
cd tests
go mod tidy
~/go/bin/ginkgo --trace --progress ./operator
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
timeout-minutes: 15
if: failure()