-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathe2e.yml
296 lines (265 loc) · 10 KB
/
e2e.yml
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
---
# e2e stage
# Contains jobs which runs e2e tests on our Docker images.
.k8s_e2e_template:
stage: e2e
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-builders/gitlab_agent_deploy:$DATADOG_AGENT_BUILDERS
tags: ["arch:amd64"]
dependencies: []
variables:
LANG: C.UTF-8
before_script:
- export DOCKER_REGISTRY_LOGIN=$($CI_PROJECT_DIR/tools/ci/aws_ssm_get_wrapper.sh $DOCKER_REGISTRY_LOGIN_SSM_KEY)
- export DOCKER_REGISTRY_PWD=$($CI_PROJECT_DIR/tools/ci/aws_ssm_get_wrapper.sh $DOCKER_REGISTRY_PWD_SSM_KEY)
- export DD_API_KEY=$($CI_PROJECT_DIR/tools/ci/aws_ssm_get_wrapper.sh $API_KEY_SSM_NAME)
.k8s-e2e-cws-cspm-init:
- set +x
- export DATADOG_AGENT_SITE=datadoghq.com
- export DATADOG_AGENT_API_KEY=$($CI_PROJECT_DIR/tools/ci/aws_ssm_get_wrapper.sh $E2E_TESTS_API_KEY_SSM_NAME)
- export DATADOG_AGENT_APP_KEY=$($CI_PROJECT_DIR/tools/ci/aws_ssm_get_wrapper.sh $E2E_TESTS_APP_KEY_SSM_NAME)
- export DATADOG_AGENT_RC_KEY=$($CI_PROJECT_DIR/tools/ci/aws_ssm_get_wrapper.sh $E2E_TESTS_RC_KEY_SSM_NAME)
.k8s_e2e_template_needs_dev:
extends: .k8s_e2e_template
needs:
- dev_branch_multiarch-a7
- dca_dev_branch
.k8s_e2e_template_dev:
extends: .k8s_e2e_template_needs_dev
script:
- inv -e e2e-tests --agent-image=datadog/agent-dev:${CI_COMMIT_REF_SLUG}-py3 --dca-image=datadog/cluster-agent-dev:${CI_COMMIT_REF_SLUG} --argo-workflow=$ARGO_WORKFLOW
.k8s_e2e_template_dev_with_cws_cspm_init:
extends: .k8s_e2e_template_needs_dev
script:
- !reference [.k8s-e2e-cws-cspm-init]
- inv -e e2e-tests --agent-image=datadog/agent-dev:${CI_COMMIT_REF_SLUG}-py3 --dca-image=datadog/cluster-agent-dev:${CI_COMMIT_REF_SLUG} --argo-workflow=$ARGO_WORKFLOW
.k8s_e2e_template_needs_main:
extends: .k8s_e2e_template
needs:
- dev_master-a7
- dca_dev_master
.k8s_e2e_template_main_with_cws_cspm_init:
extends: .k8s_e2e_template_needs_main
script:
- !reference [.k8s-e2e-cws-cspm-init]
- inv -e e2e-tests --agent-image=datadog/agent-dev:master-py3 --dca-image=datadog/cluster-agent-dev:master --argo-workflow=$ARGO_WORKFLOW
.k8s_e2e_template_main:
extends: .k8s_e2e_template_needs_main
script:
- inv -e e2e-tests --agent-image=datadog/agent-dev:master-py3 --dca-image=datadog/cluster-agent-dev:master --argo-workflow=$ARGO_WORKFLOW
k8s-e2e-cws-dev:
extends: .k8s_e2e_template_dev_with_cws_cspm_init
rules: !reference [.on_dev_branch_manual]
variables:
ARGO_WORKFLOW: cws
k8s-e2e-cws-main:
extends: .k8s_e2e_template_main_with_cws_cspm_init
rules: !reference [.on_main]
retry: 1
variables:
ARGO_WORKFLOW: cws
k8s-e2e-cspm-dev:
extends: .k8s_e2e_template_dev_with_cws_cspm_init
rules: !reference [.on_dev_branch_manual]
variables:
ARGO_WORKFLOW: cspm
k8s-e2e-cspm-main:
extends: .k8s_e2e_template_main_with_cws_cspm_init
rules: !reference [.on_main]
retry: 1
variables:
ARGO_WORKFLOW: cspm
k8s-e2e-otlp-dev:
extends: .k8s_e2e_template_dev
rules: !reference [.on_dev_branch_manual]
variables:
ARGO_WORKFLOW: otlp
k8s-e2e-otlp-main:
extends: .k8s_e2e_template_main
rules: !reference [.on_main]
variables:
ARGO_WORKFLOW: otlp
.new_e2e_template:
stage: e2e
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/test-infra-definitions/runner$TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX:$TEST_INFRA_DEFINITIONS_BUILDIMAGES
tags: ["arch:amd64"]
before_script:
# Setup AWS Credentials
- mkdir -p ~/.aws
- $CI_PROJECT_DIR/tools/ci/aws_ssm_get_wrapper.sh $AGENT_QA_PROFILE_SSM_NAME >> ~/.aws/config
- export AWS_PROFILE=agent-qa-ci
# Now all `aws` commands target the agent-qa profile
- $CI_PROJECT_DIR/tools/ci/aws_ssm_get_wrapper.sh $SSH_PUBLIC_KEY_RSA_SSM_NAME > $E2E_PUBLIC_KEY_PATH
- touch $E2E_PRIVATE_KEY_PATH && chmod 600 $E2E_PRIVATE_KEY_PATH && $CI_PROJECT_DIR/tools/ci/aws_ssm_get_wrapper.sh $SSH_KEY_RSA_SSM_NAME > $E2E_PRIVATE_KEY_PATH
# Use S3 backend
- pulumi login "s3://dd-pulumi-state?region=us-east-1&awssdk=v2&profile=$AWS_PROFILE"
variables:
KUBERNETES_MEMORY_REQUEST: 12Gi
KUBERNETES_MEMORY_LIMIT: 16Gi
KUBERNETES_CPU_REQUEST: 6
E2E_PUBLIC_KEY_PATH: /tmp/agent-qa-ssh-key.pub
E2E_PRIVATE_KEY_PATH: /tmp/agent-qa-ssh-key
E2E_KEY_PAIR_NAME: datadog-agent-ci-rsa
E2E_PIPELINE_ID: $CI_PIPELINE_ID
E2E_COMMIT_SHA: $CI_COMMIT_SHORT_SHA
E2E_OUTPUT_DIR: $CI_PROJECT_DIR/e2e-output
script:
- inv -e new-e2e-tests.run --targets $TARGETS -c ddagent:imagePullRegistry=669783387624.dkr.ecr.us-east-1.amazonaws.com -c ddagent:imagePullUsername=AWS -c ddagent:imagePullPassword=$(aws ecr get-login-password) --junit-tar junit-${CI_JOB_ID}.tgz ${EXTRA_PARAMS}
after_script:
# Upload generated junit files
- export DATADOG_API_KEY=$($CI_PROJECT_DIR/tools/ci/aws_ssm_get_wrapper.sh ci.datadog-agent.datadog_api_key_org2)
- inv -e junit-upload --tgz-path junit-${CI_JOB_ID}.tgz
artifacts:
expire_in: 2 weeks
when: always
paths:
# Root directory of the e2e tests output, if used by the test
- $E2E_OUTPUT_DIR
# junit tarball, kept for investigations
- junit-*.tgz
.new_e2e_template_needs_deb_x64:
extends: .new_e2e_template
needs:
- deploy_deb_testing-a7_x64
.new_e2e_template_needs_deb_windows_x64:
extends: .new_e2e_template
needs:
- deploy_deb_testing-a7_x64
- deploy_windows_testing-a7
.new_e2e_template_needs_container_deploy:
extends: .new_e2e_template
needs:
- qa_agent
- qa_dca
- qa_dogstatsd
new-e2e-containers:
extends:
- .new_e2e_template_needs_container_deploy
# TODO once images are deployed to ECR for dev branches, update
#.on_main_or_rc_and_no_skip_e2e adding on_dev_branch_manual rules
# and move rules to template
rules: !reference [.on_container_or_e2e_changes_or_manual]
variables:
TARGETS: ./tests/containers
TEAM: container-integrations
parallel:
matrix:
- EXTRA_PARAMS: --run TestKindSuite
- EXTRA_PARAMS: --run TestEKSSuite
- EXTRA_PARAMS: --run TestECSSuite
- EXTRA_PARAMS: --run TestDockerSuite
- EXTRA_PARAMS: --skip "Test(Kind|EKS|ECS|Docker)Suite"
new-e2e-remote-config:
extends: .new_e2e_template_needs_deb_x64
rules: !reference [.on_rc_or_e2e_changes_or_manual]
variables:
TARGETS: ./tests/remote-config
TEAM: remote-config
new-e2e-agent-shared-components:
extends: .new_e2e_template_needs_deb_windows_x64
rules: !reference [.on_asc_or_e2e_changes_or_manual]
variables:
TARGETS: ./tests/agent-shared-components
TEAM: agent-shared-components
new-e2e-agent-subcommands:
extends: .new_e2e_template_needs_deb_windows_x64
rules: !reference [.on_subcommands_or_e2e_changes_or_manual]
variables:
TARGETS: ./tests/agent-subcommands
TEAM: agent-shared-components
parallel:
matrix:
- EXTRA_PARAMS: --run TestLinuxStatusSuite
- EXTRA_PARAMS: --run TestWindowsStatusSuite
- EXTRA_PARAMS: --run TestLinuxHealthSuite
- EXTRA_PARAMS: --run TestWindowsHealthSuite
- EXTRA_PARAMS: --run TestLinuxConfigSuite
- EXTRA_PARAMS: --run TestWindowsConfigSuite
- EXTRA_PARAMS: --run TestLinuxHostnameSuite
- EXTRA_PARAMS: --run TestWindowsHostnameSuite
- EXTRA_PARAMS: --run TestLinuxDiagnoseSuite
- EXTRA_PARAMS: --run TestWindowsDiagnoseSuite
- EXTRA_PARAMS: --run TestLinuxConfigCheckSuite
- EXTRA_PARAMS: --run TestWindowsConfigCheckSuite
- EXTRA_PARAMS: --run TestLinuxFlareSuite
- EXTRA_PARAMS: --run TestWindowsFlareSuite
- EXTRA_PARAMS: --run TestLinuxSecretSuite
- EXTRA_PARAMS: --run TestWindowsSecretSuite
- EXTRA_PARAMS: --run TestLinuxCheckSuite
new-e2e-language-detection:
extends: .new_e2e_template_needs_deb_x64
rules: !reference [.on_language-detection_or_e2e_changes_or_manual]
variables:
TARGETS: ./tests/language-detection
TEAM: processes
new-e2e-npm:
extends: .new_e2e_template
rules: !reference [.on_npm_or_e2e_changes_or_manual]
needs:
- qa_agent
- deploy_deb_testing-a7_x64
- deploy_rpm_testing-a7_x64
- deploy_windows_testing-a7
variables:
TARGETS: ./tests/npm
TEAM: network-performance-monitoring
new-e2e-aml:
extends: .new_e2e_template_needs_deb_windows_x64
rules: !reference [.on_aml_or_e2e_changes_or_manual]
variables:
TARGETS: ./tests/agent-metric-logs
TEAM: agent-metric-logs
new-e2e-cws:
extends: .new_e2e_template
rules: !reference [.on_cws_or_e2e_changes_or_manual]
needs:
- deploy_deb_testing-a7_x64
- qa_cws_instrumentation
- qa_agent
variables:
TARGETS: ./tests/cws
TEAM: csm-threats-agent
CWS_INSTRUMENTATION_FULLIMAGEPATH: 669783387624.dkr.ecr.us-east-1.amazonaws.com/cws-instrumentation:${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}
parallel:
matrix:
- EXTRA_PARAMS: --run TestAgentSuite
- EXTRA_PARAMS: --run TestECSFargate
new-e2e-process:
extends: .new_e2e_template_needs_deb_windows_x64
rules: !reference [.on_process_or_e2e_changes_or_manual]
variables:
TARGETS: ./tests/process
TEAM: processes
new-e2e-orchestrator:
extends:
- .new_e2e_template_needs_container_deploy
rules: !reference [.on_orchestrator_or_e2e_changes_or_manual]
variables:
TARGETS: ./tests/orchestrator
TEAM: container-app
new-e2e-apm:
extends: .new_e2e_template
rules: !reference [.on_apm_or_e2e_changes_or_manual]
needs:
- qa_agent
- deploy_deb_testing-a7_x64
variables:
TARGETS: ./tests/apm
TEAM: apm-agent
parallel:
matrix:
- EXTRA_PARAMS: --run TestDockerFakeintakeSuiteUDS
- EXTRA_PARAMS: --run TestDockerFakeintakeSuiteTCP
- EXTRA_PARAMS: --run TestVMFakeintakeSuiteUDS
- EXTRA_PARAMS: --run TestVMFakeintakeSuiteTCP
new-e2e-updater:
extends: .new_e2e_template
rules:
!reference [.on_updater_or_e2e_changes_or_manual]
needs:
- deploy_deb_testing-u7_arm64
variables:
TARGETS: ./tests/updater
TEAM: fleet
# ^ If you create a new job here that extends `.new_e2e_template`,
# /!\ do not forget to add it in the `dependencies` statement of the
# /___\ `e2e_test_junit_upload` job in the `.gitlab/e2e_test_junit_upload.yml` file