-
Notifications
You must be signed in to change notification settings - Fork 2.1k
248 lines (226 loc) · 8.14 KB
/
integration.yml
File metadata and controls
248 lines (226 loc) · 8.14 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
# 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_dispatch:
pull_request:
merge_group:
types: [checks_requested]
concurrency:
# `github.event.number` exists for pull requests, otherwise fall back to SHA for merge queue
group: ${{ github.workflow }}-${{ github.event.number || github.event.merge_group.head_sha }}
cancel-in-progress: true
permissions:
contents: read
env:
CONTAINER_TOOL: "docker"
DD_ENV: "ci"
DD_API_KEY: ${{ secrets.DD_API_KEY }}
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 == '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: ${{ github.sha }}
integration-tests:
runs-on: ubuntu-24.04-8core
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') }}
strategy:
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@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
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" || \
"${{ 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"
- 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: ${{ github.sha }}
- name: Run Integration Tests for ${{ matrix.service }}
if: steps.check.outputs.should_run == 'true'
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 30
max_attempts: 3
command: |
bash scripts/run-integration-test.sh int ${{ matrix.service }}
e2e-tests:
runs-on: ubuntu-24.04-8core
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') }}
strategy:
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@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
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" || \
"${{ 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"
- 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: ${{ github.sha }}
- name: Run E2E Tests for ${{ matrix.service }}
if: steps.check.outputs.should_run == 'true'
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 30
max_attempts: 3
command: |
bash scripts/run-integration-test.sh e2e ${{ matrix.service }}
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