forked from vectordotdev/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
303 lines (277 loc) · 10.3 KB
/
Copy pathintegration.yml
File metadata and controls
303 lines (277 loc) · 10.3 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
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
# Integration Test Suite
#
# This workflow runs the integration tests. If the workflow is triggered in the merge queue, all integration tests
# are run. If the workflow is triggered in a PR commit, then the files changed in the PR are evaluated to determine
# if any integration tests will run.
name: Integration Test Suite
on:
workflow_call:
inputs:
run_all:
description: "Run all integration and e2e tests regardless of changed files"
required: false
type: boolean
default: false
coverage:
description: "Collect code coverage (outputs target/coverage/lcov.info per service)"
required: false
type: boolean
default: false
ref:
description: "Git ref to checkout (defaults to github.sha)"
required: false
type: string
workflow_dispatch:
pull_request:
merge_group:
types: [checks_requested]
concurrency:
# `github.event.number` exists for pull requests, otherwise fall back to SHA for merge queue.
# For workflow_call (e.g. weekly coverage), use run_id so each caller gets its own group.
group: ${{ github.workflow }}-${{ github.event.number || github.event.merge_group.head_sha || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
env:
CONTAINER_TOOL: "docker"
DD_ENV: "ci"
TEST_DATADOG_API_KEY: ${{ secrets.CI_TEST_DATADOG_API_KEY }}
TEST_APPSIGNAL_PUSH_API_KEY: ${{ secrets.TEST_APPSIGNAL_PUSH_API_KEY }}
AXIOM_TOKEN: ${{ secrets.AXIOM_TOKEN }}
RUST_BACKTRACE: full
VECTOR_LOG: vector=debug
VERBOSE: true
CI: true
PROFILE: debug
jobs:
changes:
if: github.event_name == 'merge_group'
uses: ./.github/workflows/changes.yml
with:
source: true
int_tests: true
e2e_tests: true
secrets: inherit
build-test-runner:
# Elevated permission required by build-test-runner.yml to push test runner image to GHCR
permissions:
contents: read
packages: write
needs: changes
if: ${{
always() &&
(github.event_name == 'workflow_dispatch' ||
github.event_name == 'workflow_call' ||
inputs.run_all == true ||
(github.event_name == 'merge_group' &&
needs.changes.result == 'success' &&
(needs.changes.outputs.dependencies == 'true' ||
needs.changes.outputs.integration-yml == 'true' ||
needs.changes.outputs.int-tests-any == 'true' ||
needs.changes.outputs.e2e-tests-any == 'true')))
}}
uses: ./.github/workflows/build-test-runner.yml
with:
commit_sha: ${{ inputs.ref || github.sha }}
checkout_ref: ${{ inputs.ref }}
integration-tests:
runs-on: ubuntu-24.04-8core
permissions:
contents: read
id-token: write
needs:
- changes
- build-test-runner
if: ${{ always() && !failure() && !cancelled() && needs.build-test-runner.result == 'success' &&
(github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' || inputs.run_all == true) }}
strategy:
fail-fast: false
matrix:
# TODO: Add "splunk" back once https://github.com/vectordotdev/vector/issues/23474 is fixed.
# If you modify this list, please also update the `int_tests` job in changes.yml.
service:
[
"amqp",
"appsignal",
"axiom",
"aws",
"azure",
"clickhouse",
"databend",
"datadog-agent",
"datadog-logs",
"datadog-metrics",
"datadog-traces",
"dnstap",
"docker-logs",
"doris",
"elasticsearch",
"eventstoredb",
"fluent",
"gcp",
"greptimedb",
"http-client",
"influxdb",
"kafka",
"logstash",
"loki",
"mqtt",
"mongodb",
"nats",
"nginx",
"opentelemetry",
"postgres",
"prometheus",
"pulsar",
"redis",
"webhdfs"
]
timeout-minutes: 90
steps:
- name: Download JSON artifact from changes.yml
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
if: github.event_name == 'merge_group'
with:
name: int_tests_changes
- name: Determine if test should run
id: check
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" || \
"${{ github.event_name }}" == "workflow_call" || \
"${{ inputs.run_all }}" == "true" || \
"${{ needs.changes.outputs.dependencies }}" == "true" || \
"${{ needs.changes.outputs.integration-yml }}" == "true" ]]; then
echo "should_run=true" >> "$GITHUB_OUTPUT"
elif [[ "${{ needs.changes.outputs.website_only }}" == "true" ]]; then
echo "should_run=false" >> "$GITHUB_OUTPUT"
elif [[ -f int_tests_changes.json ]]; then
should_run=$(jq -r '."${{ matrix.service }}" // false' int_tests_changes.json)
echo "should_run=${should_run}" >> "$GITHUB_OUTPUT"
else
echo "should_run=false" >> "$GITHUB_OUTPUT"
fi
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: steps.check.outputs.should_run == 'true'
with:
submodules: "recursive"
ref: ${{ inputs.ref || github.sha }}
- uses: ./.github/actions/dd-token
if: steps.check.outputs.should_run == 'true'
- uses: ./.github/actions/setup
if: steps.check.outputs.should_run == 'true'
with:
vdev: true
mold: false
cargo-cache: false
datadog-ci: true
- name: Pull test runner image
if: steps.check.outputs.should_run == 'true'
uses: ./.github/actions/pull-test-runner
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
commit_sha: ${{ inputs.ref || github.sha }}
- name: Run Integration Tests for ${{ matrix.service }}
if: steps.check.outputs.should_run == 'true'
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
with:
timeout_minutes: 30
max_attempts: 3
command: |
bash scripts/run-integration-test.sh ${{ inputs.coverage && '-c' || '' }} int ${{ matrix.service }}
- name: Upload coverage artifact
if: inputs.coverage && always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: coverage-int-${{ matrix.service }}
path: target/coverage/lcov.info
if-no-files-found: ignore
e2e-tests:
runs-on: ubuntu-24.04-8core
permissions:
contents: read
id-token: write
needs:
- changes
- build-test-runner
if: ${{ always() && !failure() && !cancelled() && needs.build-test-runner.result == 'success' &&
(github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' || inputs.run_all == true) }}
strategy:
fail-fast: false
matrix:
service: ["datadog-logs", "datadog-metrics", "opentelemetry-logs", "opentelemetry-metrics"]
timeout-minutes: 90
steps:
- name: Download JSON artifact from changes.yml
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
if: github.event_name == 'merge_group'
with:
name: e2e_tests_changes
- name: Determine if test should run
id: check
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" || \
"${{ github.event_name }}" == "workflow_call" || \
"${{ inputs.run_all }}" == "true" || \
"${{ needs.changes.outputs.dependencies }}" == "true" || \
"${{ needs.changes.outputs.integration-yml }}" == "true" ]]; then
echo "should_run=true" >> "$GITHUB_OUTPUT"
elif [[ "${{ needs.changes.outputs.website_only }}" == "true" ]]; then
echo "should_run=false" >> "$GITHUB_OUTPUT"
elif [[ -f e2e_tests_changes.json ]]; then
should_run=$(jq -r '."${{ matrix.service }}" // false' e2e_tests_changes.json)
echo "should_run=${should_run}" >> "$GITHUB_OUTPUT"
else
echo "should_run=false" >> "$GITHUB_OUTPUT"
fi
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: steps.check.outputs.should_run == 'true'
with:
submodules: "recursive"
ref: ${{ inputs.ref || github.sha }}
- uses: ./.github/actions/dd-token
if: steps.check.outputs.should_run == 'true'
- uses: ./.github/actions/setup
if: steps.check.outputs.should_run == 'true'
with:
vdev: true
mold: false
cargo-cache: false
datadog-ci: true
- name: Pull test runner image
if: steps.check.outputs.should_run == 'true'
uses: ./.github/actions/pull-test-runner
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
commit_sha: ${{ inputs.ref || github.sha }}
- name: Run E2E Tests for ${{ matrix.service }}
if: steps.check.outputs.should_run == 'true'
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
with:
timeout_minutes: 30
max_attempts: 3
command: |
bash scripts/run-integration-test.sh ${{ inputs.coverage && '-c' || '' }} e2e ${{ matrix.service }}
- name: Upload coverage artifact
if: inputs.coverage && always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: coverage-e2e-${{ matrix.service }}
path: target/coverage/lcov.info
if-no-files-found: ignore
integration-test-suite:
name: Integration Test Suite
runs-on: ubuntu-24.04
if: always()
needs:
- changes
- build-test-runner
- integration-tests
- e2e-tests
steps:
- run: |
if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
echo "One or more jobs failed or were cancelled"
exit 1
else
echo "All jobs completed successfully"
fi