forked from open-telemetry/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
167 lines (159 loc) · 5.35 KB
/
Copy pathe2e-tests.yml
File metadata and controls
167 lines (159 loc) · 5.35 KB
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
name: e2e-tests
on:
push:
branches:
- main
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
paths-ignore:
- "**/README.md"
pull_request:
paths-ignore:
- "**/README.md"
merge_group:
permissions:
contents: read
env:
# Make sure to exit early if cache segment download times out after 2 minutes.
# We limit cache download as a whole to 5 minutes.
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
jobs:
collector-build:
runs-on: ubuntu-24.04
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: ./.github/actions/setup-go-tools
with:
go-version: oldstable
- name: Generate otelcontribcol files
run: make genotelcontribcol
- name: Build Collector
run: make otelcontribcol
- name: Upload Collector Binary
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: collector-binary
path: ./bin/*
- run: ./.github/workflows/scripts/check-disk-space.sh
supervisor-test:
runs-on: ubuntu-24.04
needs: collector-build
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: ./.github/actions/setup-go-tools
with:
go-version: oldstable
- name: Download Collector Binary
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: collector-binary
path: bin/
- run: chmod +x bin/*
- name: Run opampsupervisor e2e tests
run: |
cd cmd/opampsupervisor
make e2e-test
- run: ./.github/workflows/scripts/check-disk-space.sh
datadog-examples-test:
runs-on: ubuntu-24.04
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: ./.github/actions/setup-go-tools
with:
go-version: oldstable
- name: Validate Datadog example configs
run: |
cd internal/datadog/e2e
go test -v -tags=e2e -timeout 10m ./...
- run: ./.github/workflows/scripts/check-disk-space.sh
docker-build:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: ./.github/actions/setup-go-tools
with:
go-version: oldstable
- name: Generate otelcontribcol files
run: make genotelcontribcol
- name: Build Docker Image
run: |
make docker-otelcontribcol
- name: export image to tar
run: |
docker save otelcontribcol:latest > /tmp/otelcontribcol.tar
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: otelcontribcol
path: /tmp/otelcontribcol.tar
- run: ./.github/workflows/scripts/check-disk-space.sh
kubernetes-test-matrix:
env:
KUBECONFIG: /tmp/kube-config-otelcol-e2e-testing
strategy:
fail-fast: false
matrix:
k8s-version:
- "v1.34.0"
- "v1.35.0"
component:
- receiver/k8sclusterreceiver
- processor/k8sattributesprocessor
- processor/resourcedetectionprocessor
- receiver/kubeletstatsreceiver
- receiver/k8seventsreceiver
- receiver/k8sobjectsreceiver
- extension/observer/k8sobserver
runs-on: ubuntu-24.04
needs: docker-build
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: ./.github/actions/setup-go-tools
with:
go-version: oldstable
- name: Create kind cluster
uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1.14.0
with:
node_image: kindest/node:${{ matrix.k8s-version }}
kubectl_version: ${{ matrix.k8s-version }}
cluster_name: kind
config: ./.github/workflows/configs/e2e-kind-config.yaml
- name: Fix kubelet TLS server certificates
run: |
kubectl get csr -o=jsonpath='{range.items[?(@.spec.signerName=="kubernetes.io/kubelet-serving")]}{.metadata.name}{" "}{end}' | xargs kubectl certificate approve
- name: Download artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: otelcontribcol
path: /tmp
- name: Load Docker image
run: |
docker load --input /tmp/otelcontribcol.tar
- name: Kind load image
run: |
kind load docker-image otelcontribcol:latest --name kind
- name: Run e2e tests
run: |
cd ${{ matrix.component }}
go test -v --tags=e2e -timeout 20m
- run: ./.github/workflows/scripts/check-disk-space.sh
kubernetes-test:
if: ${{ github.actor != 'dependabot[bot]' && always() }}
runs-on: ubuntu-24.04
needs: [kubernetes-test-matrix]
steps:
- name: Print result
run: echo ${{ needs.kubernetes-test-matrix.result }}
- name: Interpret result
run: |
if [[ success == ${{ needs.kubernetes-test-matrix.result }} ]]
then
echo "All matrix jobs passed!"
else
echo "One or more matrix jobs failed."
false
fi