-
Notifications
You must be signed in to change notification settings - Fork 8
176 lines (145 loc) · 4.27 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
name: E2E-Test
on:
pull_request:
branches: [main]
defaults:
run:
shell: bash
jobs:
docker-build:
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "~1.21.3"
check-latest: true
cache-dependency-path: internal/tools/go.sum
- name: Cache tools
uses: actions/cache@v4
with:
path: .tools
key: ci-tools-${{ runner.os }}-${{ hashFiles('internal/tools/go.sum') }}
- name: Touch tools
run: |
mkdir -p .tools
touch .tools/*
- 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:
env:
KUBECONFIG: /tmp/kube-config-collector-e2e-testing
strategy:
fail-fast: false
matrix:
usecase:
- k8senrichment
- prometheus
- zipkin
- statsd
runs-on: ubuntu-latest
needs: docker-build
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "~1.21.3"
check-latest: true
cache-dependency-path: internal/tools/go.sum
- name: Cache tools
uses: actions/cache@v4
with:
path: .tools
key: ci-tools-${{ runner.os }}-${{ hashFiles('internal/tools/go.sum') }}
- name: Touch tools
run: |
mkdir -p .tools
touch .tools/*
- name: Create kind cluster
uses: helm/[email protected]
with:
node_image: "kindest/node:v1.27.11"
kubectl_version: "v1.27.11"
cluster_name: kind
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: dynatrace-otel-collector-image
path: /tmp
- name: Load Docker image
run: |
docker load --input /tmp/dynatrace-otel-collector.tar
- name: Kind load image
run: |
kind load docker-image dynatrace-otel-collector:e2e-test --name kind
- name: Load Image into Kind
shell: bash
run: |
kind load docker-image dynatrace-otel-collector:e2e-test --name kind
- name: Run e2e tests
run: |
cd internal/testbed/integration/${{ matrix.usecase }}
go test -v --tags=e2e
eec-confmap-provider:
runs-on: ubuntu-latest
needs: docker-build
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "~1.21.3"
check-latest: true
cache-dependency-path: internal/tools/go.sum
- name: Cache tools
uses: actions/cache@v4
with:
path: .tools
key: ci-tools-${{ runner.os }}-${{ hashFiles('internal/tools/go.sum') }}
- name: Touch tools
run: |
mkdir -p .tools
touch .tools/*
- 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