-
Notifications
You must be signed in to change notification settings - Fork 67
137 lines (116 loc) · 5.2 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
name: KinD e2e tests
on:
push:
branches: ["main", "release-*"]
pull_request:
branches: ["main", "release-*"]
jobs:
ko-resolve:
name: e2e tests
runs-on: ubuntu-latest
strategy:
fail-fast: false # Keep running if one leg fails.
matrix:
k8s-version:
- v1.28.7
knative-version:
- 1.13.0
# 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.16.0
include:
- k8s-version: v1.28.7
kind-version: v0.21.0
kind-image-sha: sha256:9bc6c451a289cf96ad0bbaf33d416901de6fd632415b076ab05f5fa7e4f65c58
use-eventing-latest: ""
knative-version: 1.13.0
steps:
- name: Defaults
run: |
if [[ "${{ secrets.SLACK_WEBHOOK }}" != "" ]]; then
echo "SLACK_WEBHOOK=exists" >> $GITHUB_ENV
fi
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.x
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Merge upstream
if: github.event_name == 'pull_request'
run: |
if ! git config user.name > /dev/null; then
git config user.name "John Doe"
fi
if ! git config user.email > /dev/null; then
git config user.email "johndoe@localhost"
fi
git remote add upstream https://github.com/${{ github.repository }}.git
git fetch upstream ${{ github.base_ref }}
git pull --no-rebase --no-commit upstream ${{ github.base_ref }}
shell: bash
- name: Setup a local KIND Cluster with everything that is needed to run tests
run: |
make install \
KIND_K8S_VERSION=${{ matrix.k8s-version }} \
KIND_K8S_DIGEST=${{ matrix.kind-image-sha }} \
KNATIVE_VERSION=${{ matrix.knative-version }} \
USE_LATEST_EVENTING=${{ matrix.use-eventing-latest }}
- name: Run ko publish e2e Tests
run: |
make test-e2e-publish
# Run only Broker specific tests due to large resource requirements of rabbitmqcluster
- name: Run Broker e2e Tests
run: |
make test-e2e-broker
# Run source test
- name: Run source e2e Tests
run: |
make test-e2e-source
- name: Gather Failure Data
if: ${{ failure() }}
run: |
set -x
echo "===================== Brokers =============================="
kubectl get broker --all-namespaces=true -oyaml
echo "===================== Triggers ============================="
kubectl get trigger --all-namespaces=true -oyaml
echo "===================== RabbitMQClusters ====================="
kubectl get RabbitMQCluster --all-namespaces=true -oyaml
echo "===================== RabbitMQ Exchanges ====================="
kubectl get exchange.rabbitmq.com --all-namespaces=true -oyaml
echo "===================== RabbitMQ Queues ====================="
kubectl get queue.rabbitmq.com --all-namespaces=true -oyaml
echo "===================== RabbitMQ Bindings ====================="
kubectl get binding.rabbitmq.com --all-namespaces=true -oyaml
echo "===================== K8s Events ==========================="
kubectl get events --all-namespaces=true -oyaml
echo "===================== Pod Logs ============================="
namespaces=(knative-eventing rabbitmq-system)
for namespace in ${namespaces[@]}; do
for pod in $(kubectl get pod -n $namespace | awk '{print $1}'); do
for container in $(kubectl get pod "${pod}" -n $namespace -ojsonpath='{.spec.containers[*].name}'); do
echo "Namespace, Pod, Container: ${namespace}, ${pod}, ${container}"
kubectl logs -n $namespace "${pod}" -c "${container}" || true
echo "----------------------------------------------------------"
echo "Namespace, Pod, Container (Previous instance): ${namespace}, ${pod}, ${container}"
kubectl logs -p -n $namespace "${pod}" -c "${container}" || true
echo "============================================================"
done
done
done
- name: Post failure notice to Slack
# Note: using env.SLACK_WEBHOOK here because secrets are not allowed in the if block.
if: ${{ env.SLACK_WEBHOOK != '' && failure() && github.event_name != 'pull_request' }}
uses: rtCamp/action-slack-notify@v2.1.0
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 for RabbitMQ on kind on (${{ matrix.k8s-version }}, ${{ matrix.knative-version }}) failed.
SLACK_MESSAGE: |
For detailed logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}