forked from knative-extensions/eventing-kafka-broker
-
Notifications
You must be signed in to change notification settings - Fork 0
182 lines (147 loc) · 5.87 KB
/
kind-e2e.yaml
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: KinD e2e tests
on:
pull_request:
branches: [ 'main', 'release-*' ]
defaults:
run:
shell: bash
working-directory: ./src/knative.dev/eventing-kafka-broker
jobs:
e2e-tests:
name: e2e tests
runs-on: ubuntu-latest
strategy:
fail-fast: false # Keep running if one leg fails.
matrix:
k8s-version:
- v1.19.11
- v1.20.7
- v1.21.1
eventing-config:
- "./third_party/eventing-latest/"
- "./third_party/eventing-v0.23.0/"
- "./third_party/eventing-v0.22.1/"
test-suite:
- ./test/e2e
- ./test/e2e_new
# Map between K8s and KinD versions.
# This is attempting to make it a bit clearer what's being tested.
# See: https://github.com/kubernetes-sigs/kind/releases/tag/v0.9.0
include:
- k8s-version: v1.19.11
kind-version: v0.11.1
kind-image-sha: sha256:07db187ae84b4b7de440a73886f008cf903fcf5764ba8106a9fd5243d6f32729
- k8s-version: v1.20.7
kind-version: v0.11.1
kind-image-sha: sha256:cbeaf907fc78ac97ce7b625e4bf0de16e3ea725daf6b04f930bd14c67c671ff9
- k8s-version: v1.21.1
kind-version: v0.11.1
kind-image-sha: sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6
env:
GOPATH: ${{ github.workspace }}
GO111MODULE: off
KO_DOCKER_REPO: kind.local
REPLICAS: 1
SYSTEM_NAMESPACE: knative-eventing
# Use a semi-random cluster suffix, but somewhat predictable
# so reruns don't just give us a completely new value.
CLUSTER_SUFFIX: c${{ github.run_id }}.local
ARTIFACTS: ${{ github.workspace }}/artifacts
EVENTING_CONFIG: ${{ matrix.eventing-config }}
NODE_VERSION: ${{ matrix.k8s-version }}
NODE_SHA: ${{ matrix.kind-image-sha }}
steps:
- name: Install Dependencies
working-directory: ./
run: |
echo '::group:: install ko'
curl -L https://github.com/google/ko/releases/download/v0.8.1/ko_0.8.1_Linux_x86_64.tar.gz | tar xzf - ko
chmod +x ./ko
sudo mv ko /usr/local/bin
echo '::endgroup::'
- name: Set up Go 1.16.x
uses: actions/setup-go@v2
with:
go-version: 1.16.x
- name: Check out code onto GOPATH
uses: actions/checkout@v2
with:
path: ./src/knative.dev/eventing-kafka-broker
- name: Install KinD
run: |
set -x
# Disable swap otherwise memory enforcement doesn't work
# See: https://kubernetes.slack.com/archives/CEKK1KTN2/p1600009955324200
sudo swapoff -a
sudo rm -f /swapfile
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${{ matrix.kind-version }}/kind-$(uname)-amd64
chmod +x ./kind
sudo mv kind /usr/local/bin
- name: Create KinD Cluster
run: ./hack/create-kind-cluster.sh
- name: Install Dependencies (Eventing, Kafka, etc)
run: ./hack/run.sh deploy-infra
- name: Install Eventing Kafka Broker
run: ./hack/run.sh deploy
- name: Wait for things to be up
run: |
source test/e2e-common.sh
# Kafka and Zookeeper are dinamically created by strimzi and don't exist yet, so sleep a "bit".
sleep 5m
free
kubectl wait deployment -v 9 --all --timeout=-1s --for=condition=Available -n knative-eventing
kubectl wait deployment -v 9 --all --timeout=-1s --for=condition=Available -n kafka
kubectl describe -n kafka kafka my-cluster
# Print all pods in the cluster.
kubectl get pods -v 9 -A
wait_until_pods_running kafka && wait_until_pods_running knative-eventing
- name: Run e2e Tests
run: |
export KO_FLAGS="--platform=linux/amd64"
export GO111MODULE=on
export GOFLAGS=-mod=vendor
export SYSTEM_NAMESPACE=knative-eventing
export CLUSTER_DOMAIN=${CLUSTER_SUFFIX}
# Run the tests tagged as e2e on the KinD cluster.
go test -race -count=1 -timeout=1h -v -short -tags=e2e \
${{ matrix.test-suite }} ${{ matrix.extra-test-flags }}
- name: Teardown Eventing Kafka Broker
run: ./hack/run.sh teardown
- name: Collect system diagnostics
if: ${{ failure() }}
run: |
kubectl -n${SYSTEM_NAMESPACE} get pods
echo '::group:: describe'
kubectl -n${SYSTEM_NAMESPACE} describe pods
echo '::endgroup::'
for x in $(kubectl get pods -n${SYSTEM_NAMESPACE} -oname); do
echo "::group:: describe $x"
kubectl -n${SYSTEM_NAMESPACE} describe $x
echo '::endgroup::'
echo "::group:: $x logs"
kubectl -n${SYSTEM_NAMESPACE} logs $x --all-containers
echo '::endgroup::'
done
- name: Dump Artifacts
if: ${{ failure() }}
run: |
if [[ -d ${{ env.ARTIFACTS }} ]]; then
cd ${{ env.ARTIFACTS }}
for x in $(find . -type f); do
echo "::group:: artifact $x"
cat $x
echo '::endgroup::'
done
fi
- name: Post failure notice to Slack
uses: rtCamp/[email protected]
if: ${{ failure() && github.event_name != 'pull_request' }}
env:
SLACK_ICON: http://github.com/knative.png?size=48
SLACK_USERNAME: github-actions
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: 'eventing-delivery'
MSG_MINIMAL: 'true'
SLACK_TITLE: Periodic e2e on kind failed. (k8s ${{ matrix.k8s-version }} - eventing ${{ matrix.eventing-config }})
SLACK_MESSAGE: |
For detailed logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}