-
Notifications
You must be signed in to change notification settings - Fork 8
204 lines (173 loc) · 5.4 KB
/
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
name: E2E-Test
on:
pull_request:
branches: [main]
push:
branches: [main]
defaults:
run:
shell: bash
env:
KUBECONFIG: /tmp/kube-config-collector-e2e-testing
# renovate: datasource=golang-version depName=go
GO_VERSION: "1.23.4"
jobs:
docker-build:
runs-on: ubuntu-24.04
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: false
- name: Cache tools
id: cache-tools
uses: actions/cache@v4
with:
path: .tools
key: e2e-tools-${{ runner.os }}-${{ hashFiles('internal/tools/go.sum') }}
- name: Install tools
if: steps.cache-tools.outputs.cache-hit != 'true'
run: |
mkdir -p .tools
touch .tools/*
make install-tools
- name: Generate source files
run: make generate
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: e2e-mods-${{ runner.os }}-${{ hashFiles('build/go.sum') }}
- name: Build collector artifact
shell: bash
run: |
echo "Building collector artifact"
make build
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
name: dynatrace-otel-collector-bin
path: bin/dynatrace-otel-collector
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push to local registry
uses: docker/build-push-action@v6
with:
context: ./bin
file: Dockerfile
push: false
load: true
tags: dynatrace-otel-collector:e2e-test
- name: export image to tar
run: |
docker save dynatrace-otel-collector:e2e-test > /tmp/dynatrace-otel-collector.tar
- name: Upload container image artifact
uses: actions/upload-artifact@v4
with:
name: dynatrace-otel-collector-image
path: /tmp/dynatrace-otel-collector.tar
k8s-e2e-test-matrix:
strategy:
fail-fast: false
matrix:
usecase:
- k8senrichment
- prometheus
- zipkin
- statsd
- redaction
runs-on: ubuntu-24.04
needs: docker-build
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup cluster
uses: ./.github/actions/create-cluster
- name: Run e2e tests
run: |
cd internal/testbed/integration/${{ matrix.usecase }}
go test -v --tags=e2e
combined-load-test:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: "Linux-x64-16-64GB-Runner" # Ubuntu 24.04
needs: docker-build
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup cluster
uses: ./.github/actions/create-cluster
- name: Run e2e tests
run: |
cd internal/testbed/integration/combinedload
go test -v --tags=e2e
helm-install-test:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-24.04
needs: docker-build
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup cluster
uses: ./.github/actions/create-cluster
- name: Run helm installation
env:
REPOSITORY: "dynatrace-otel-collector"
TAG: "e2e-test"
run: |
./internal/testbed/scripts/install_dt_collector_helm.sh || exit 1;
eec-confmap-provider:
runs-on: ubuntu-24.04
needs: docker-build
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: false
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: dynatrace-otel-collector-bin
path: bin
- run: chmod +x bin/*
- name: Run e2e tests
run: |
cd internal/confmap/provider/eecprovider
go test -v --tags=e2e
notify-slack-combined-load-test:
runs-on: ubuntu-24.04
needs: [combined-load-test]
if: failure() && github.event_name == 'push'
steps:
- name: Slack Notification
uses: rtCamp/[email protected]
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_TITLE: "DT OTel Collector Distro - Combined Load Test Failure"
SLACK_COLOR: "failure"
SLACK_USERNAME: "GitHub Actions Notifier"
SLACK_ICON: "https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/github.png"
notify-slack-e2e-tests:
runs-on: ubuntu-24.04
needs: [k8s-e2e-test-matrix, eec-confmap-provider]
if: failure() && github.event_name == 'push'
steps:
- name: Slack Notification
uses: rtCamp/[email protected]
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_TITLE: "DT OTel Collector Distro - E2E Test Failure"
SLACK_COLOR: "failure"
SLACK_USERNAME: "GitHub Actions Notifier"
SLACK_ICON: "https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/png/github.png"