-
Notifications
You must be signed in to change notification settings - Fork 597
172 lines (141 loc) · 5.47 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
name: KinD e2e tests
on:
pull_request:
branches: [ 'main', 'master' ]
defaults:
run:
shell: bash
jobs:
e2e-tests:
name: e2e tests
runs-on: ubuntu-latest
strategy:
fail-fast: false # Keep running if one leg fails.
matrix:
k8s-version:
- v1.28.7
- v1.29.0
test-suite:
- ./test/e2e
- ./test/conformance
- ./test/experimental
# 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.20.0
include:
- k8s-version: v1.28.7
kind-version: v0.21.0
kind-image-sha: sha256:9bc6c451a289cf96ad0bbaf33d416901de6fd632415b076ab05f5fa7e4f65c58
- k8s-version: v1.29.0
kind-version: v0.21.0
kind-image-sha: sha256:eaa1450915475849a73a9227b8f201df25e55e268e5d619312131292e324d570
# Add the flags we use for each of these test suites.
- test-suite: ./test/e2e
extra-test-flags: >
-channels=messaging.knative.dev/v1:Channel,messaging.knative.dev/v1:InMemoryChannel
-sources=sources.knative.dev/v1:ApiServerSource,sources.knative.dev/v1:ContainerSource,sources.knative.dev/v1beta2:PingSource
- test-suite: ./test/conformance
extra-test-flags: >
-brokers=eventing.knative.dev/v1:MTChannelBasedBroker
-channels=messaging.knative.dev/v1:Channel,messaging.knative.dev/v1:InMemoryChannel
-sources=sources.knative.dev/v1:ApiServerSource,sources.knative.dev/v1:ContainerSource,sources.knative.dev/v1beta2:PingSource
env:
KO_DOCKER_REPO: kind.local
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
NODE_VERSION: ${{ matrix.k8s-version }}
NODE_SHA: ${{ matrix.kind-image-sha }}
steps:
- name: Set up Go
uses: knative/actions/setup-go@main
# Install the latest release of ko
- name: Install ko
uses: ko-build/[email protected]
- name: Check out code onto GOPATH
uses: actions/checkout@v2
- 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 Knative Eventing
run: |
set -o pipefail
kubectl create namespace ${SYSTEM_NAMESPACE}
export KO_FLAGS="--platform=linux/amd64"
source ./test/e2e-common.sh
knative_setup
# Be KinD to these tests.
kubectl scale -n${SYSTEM_NAMESPACE} deployment/chaosduck --replicas=0
- name: Test Setup
run: |
source ./test/e2e-common.sh
test_setup
- name: Apply experimental features config
if: matrix.test-suite == './test/experimental'
run: |
kubectl apply -f ./test/experimental/config
- name: Wait for things to be up
run: |
set -e
source ./vendor/knative.dev/hack/infra-library.sh
wait_until_pods_running ${SYSTEM_NAMESPACE}
- name: Run e2e Tests
run: |
export CLUSTER_DOMAIN=${CLUSTER_SUFFIX}
# Run the tests tagged as e2e on the KinD cluster.
go test -race -count=1 -parallel=12 -timeout=90m -tags=e2e \
${{ matrix.test-suite }} ${{ matrix.extra-test-flags }}
- name: Collect system diagnostics
if: ${{ failure() }}
run: |
echo '::group:: all pods'
kubectl get pods --all-namespaces=true
echo '::endgroup::'
echo '::group:: describe system pods'
kubectl -n${SYSTEM_NAMESPACE} describe pods
echo '::endgroup::'
for x in $(kubectl get pods -n${SYSTEM_NAMESPACE} -oname); do
echo "::group:: describe system $x"
kubectl -n${SYSTEM_NAMESPACE} describe $x
echo '::endgroup::'
echo "::group:: $x system logs"
kubectl -n${SYSTEM_NAMESPACE} logs $x --all-containers
echo '::endgroup::'
done
echo "::group:: all events"
kubectl get events --all-namespaces=true
echo '::endgroup::'
- 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'
MSG_MINIMAL: 'true'
SLACK_TITLE: Periodic e2e on kind on ${{ matrix.k8s-version }} failed.
SLACK_MESSAGE: |
For detailed logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}