-
Notifications
You must be signed in to change notification settings - Fork 133
Expand file tree
/
Copy pathe2e-tests-kind-quay-pipeline.yaml
More file actions
333 lines (331 loc) · 12.5 KB
/
Copy pathe2e-tests-kind-quay-pipeline.yaml
File metadata and controls
333 lines (331 loc) · 12.5 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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
---
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
name: e2e-tests-kind-quay-pipeline
spec:
description: |-
This pipeline automates e2e testing of release pipelines using a self-hosted Quay
registry deployed on an ephemeral Kind cluster. It provisions the cluster, deploys
Konflux with Quay enabled, initializes Quay, and runs the e2e tests.
params:
- name: SNAPSHOT
description: 'The JSON string representing the snapshot of the application under test.'
default: '{"components": [{"name":"test-app", "containerImage": "quay.io/example/repo:latest"}]}'
type: string
- name: test-name
description: 'The name of the test corresponding to a defined Konflux integration test.'
default: ''
type: string
- name: ocp-version
description: 'The OpenShift version to use for the ephemeral cluster deployment.'
type: string
- name: test-event-type
description: 'Indicates if the test is triggered by a Pull Request or Push event.'
default: 'none'
- name: konflux-test-infra-secret
description: The name of the secret where testing infrastructure credentials are stored.
type: string
- name: replicas
description: 'The number of replicas for the cluster nodes.'
type: string
- name: machine-type
description: 'The type of machine to use for the cluster nodes.'
type: string
- name: oci-container-repo
default: 'quay.io/konflux-test-storage/konflux-team/release-service-catalog'
description: The ORAS container used to store all test artifacts.
- name: component-image
default: 'none'
description: 'Container image built from any konflux git repo. Use this param only when you run Konflux e2e tests
in another Konflux component repo. Will pass the component built image from the snapshot.'
- name: artifact-browser-url
description: "URL to the artifact browser deployment. If provided, a link will be added to PR comments."
default: ""
type: string
- name: pipeline-test-suite
type: string
description: 'The name of the test corresponding to a defined Konflux integration test.'
- name: pipeline-used
default: ''
type: string
description: |
The pipeline that is used by the test suite.
If empty, use the pipeline-test-suite as the pipeline to be used
- name: vault-password-secret-name
description: The name of the secret containing the ansible vault password.
type: string
default: 'e2e-test-vault-password'
tasks:
- name: test-metadata
taskRef:
resolver: git
params:
- name: url
value: https://github.com/konflux-ci/tekton-integration-catalog.git
- name: revision
value: main
- name: pathInRepo
value: tasks/test-metadata/0.1/test-metadata.yaml
params:
- name: SNAPSHOT
value: $(params.SNAPSHOT)
- name: test-name
value: $(context.pipelineRun.name)
- name: check-if-related-test
when:
- input: "$(tasks.test-metadata.results.pull-request-author)"
operator: notin
values: ["red-hat-konflux[bot]"]
runAfter:
- test-metadata
taskRef:
resolver: git
params:
- name: url
value: https://github.com/konflux-ci/community-catalog
- name: revision
value: development
- name: pathInRepo
value: tasks/check-if-related-test/check-if-related-test.yaml
params:
- name: pipeline-test-suite
value: $(params.pipeline-test-suite)
- name: pipeline-used
value: $(params.pipeline-used)
- name: component-image
value: $(tasks.test-metadata.results.container-image)
- name: provision-kind-cluster
runAfter:
- check-if-related-test
when:
- input: "$(tasks.test-metadata.results.pull-request-author)"
operator: notin
values: ["red-hat-konflux[bot]"]
- input: "$(tasks.check-if-related-test.results.result)"
operator: in
values: ["true"]
taskRef:
resolver: git
params:
- name: url
value: https://github.com/konflux-ci/tekton-integration-catalog
- name: revision
value: main
- name: pathInRepo
value: tasks/mapt-oci/kind-aws-spot/provision/0.2/kind-aws-provision.yaml
params:
- name: secret-aws-credentials
value: mapt-kind-secret
- name: cluster-access-secret-name
value: kfg-$(context.pipelineRun.name)
- name: id
value: $(context.pipelineRun.name)
- name: tags
value: 'owner=konflux-devprod@redhat.com,project=Konflux,created-by=integration-pipeline,component=release-service-catalog'
- name: debug
value: 'false'
- name: ownerKind
value: PipelineRun
- name: ownerName
value: $(context.pipelineRun.name)
- name: ownerUid
value: $(context.pipelineRun.uid)
- name: oci-ref
value: $(params.oci-container-repo):$(context.pipelineRun.name)
- name: credentials-secret-name
value: $(params.konflux-test-infra-secret)
- name: deploy-konflux
when:
- input: "$(tasks.test-metadata.results.pull-request-author)"
operator: notin
values: ["red-hat-konflux[bot]"]
- input: "$(tasks.check-if-related-test.results.result)"
operator: in
values: ["true"]
runAfter:
- provision-kind-cluster
taskRef:
resolver: git
params:
- name: url
value: https://github.com/konflux-ci/tekton-integration-catalog
- name: revision
value: main
- name: pathInRepo
value: tasks/konflux-ci/deploy/0.2/deploy-konflux-ci.yaml
params:
- name: cluster-access-secret
value: kfg-$(context.pipelineRun.name)
- name: repo-url
value: https://github.com/konflux-ci/konflux-ci.git
- name: repo-branch
value: legacy
- name: component-name
value: release-service-catalog
- name: component-pr-owner
value: $(tasks.test-metadata.results.pull-request-author)
- name: component-pr-sha
value: ""
- name: component-pr-source-branch
value: $(tasks.test-metadata.results.source-repo-branch)
- name: oci-ref
value: $(params.oci-container-repo):$(context.pipelineRun.name)
- name: credentials-secret-name
value: $(params.konflux-test-infra-secret)
- name: skip-quay
value: "false"
- name: self-hosted-quay-test
timeout: 3h
when:
- input: "$(tasks.test-metadata.results.pull-request-author)"
operator: notin
values: ["red-hat-konflux[bot]"]
- input: "$(tasks.check-if-related-test.results.result)"
operator: in
values: ["true"]
runAfter:
- deploy-konflux
params:
- name: cluster-access-secret
value: kfg-$(context.pipelineRun.name)
- name: git-url
value: "$(tasks.test-metadata.results.git-url)"
- name: git-revision
value: "$(tasks.test-metadata.results.git-revision)"
- name: vault-password-secret-name
value: "$(params.vault-password-secret-name)"
taskSpec:
params:
- name: cluster-access-secret
- name: git-url
- name: git-revision
- name: vault-password-secret-name
volumes:
- name: cluster-kubeconfig
secret:
secretName: $(params.cluster-access-secret)
steps:
- name: run-test
image: quay.io/konflux-ci/release-service-utils@sha256:2564e407e9709c38481dcfd59b7f1f89784096ca8888568070e7597af097a351
env:
- name: KUBECONFIG
value: /tmp/cluster-kubeconfig/kubeconfig
- name: RELEASE_CATALOG_GIT_URL
value: $(params.git-url)
- name: RELEASE_CATALOG_GIT_REVISION
value: $(params.git-revision)
- name: VAULT_PASSWORD
valueFrom:
secretKeyRef:
name: $(params.vault-password-secret-name)
key: password
volumeMounts:
- name: cluster-kubeconfig
mountPath: /tmp/cluster-kubeconfig
script: |
#!/usr/bin/env bash
set -euo pipefail
echo "Cloning release-service-catalog at revision ${RELEASE_CATALOG_GIT_REVISION}..."
git init /workspace/catalog
cd /workspace/catalog
git fetch --depth 1 "${RELEASE_CATALOG_GIT_URL}" "${RELEASE_CATALOG_GIT_REVISION}"
git checkout FETCH_HEAD
echo "Running self-hosted Quay e2e test..."
/workspace/catalog/integration-tests/push-to-external-registry-self-hosted-quay/test-kind.sh
finally:
- name: deprovision-kind-cluster
when:
- input: "$(tasks.test-metadata.results.pull-request-author)"
operator: notin
values: ["red-hat-konflux[bot]"]
- input: "$(tasks.check-if-related-test.results.result)"
operator: in
values: ["true"]
taskRef:
resolver: git
params:
- name: url
value: https://github.com/konflux-ci/tekton-integration-catalog
- name: revision
value: main
- name: pathInRepo
value: tasks/mapt-oci/kind-aws-spot/deprovision/0.1/kind-aws-deprovision.yaml
params:
- name: secret-aws-credentials
value: mapt-kind-secret
- name: id
value: $(context.pipelineRun.name)
- name: cluster-access-secret
value: kfg-$(context.pipelineRun.name)
- name: oci-container
value: $(params.oci-container-repo):$(context.pipelineRun.name)
- name: oci-credentials
value: konflux-test-infra
- name: pull-request-status-message
when:
- input: "$(tasks.test-metadata.results.pull-request-author)"
operator: notin
values: ["red-hat-konflux[bot]"]
- input: "$(tasks.check-if-related-test.results.result)"
operator: in
values: ["true"]
taskRef:
resolver: git
params:
- name: url
value: https://github.com/konflux-ci/tekton-integration-catalog.git
- name: revision
value: main
- name: pathInRepo
value: tasks/pull-request-comment/0.1/pull-request-comment.yaml
params:
- name: test-name
value: "$(context.pipelineRun.name)"
- name: oci-container
value: "$(params.oci-container-repo):$(context.pipelineRun.name)"
- name: pipeline-aggregate-status
value: "$(tasks.status)"
- name: pull-request-author
value: "$(tasks.test-metadata.results.pull-request-author)"
- name: pull-request-number
value: "$(tasks.test-metadata.results.pull-request-number)"
- name: git-repo
value: "$(tasks.test-metadata.results.git-repo)"
- name: git-org
value: "$(tasks.test-metadata.results.git-org)"
- name: git-revision
value: "$(tasks.test-metadata.results.git-revision)"
- name: junit-report-name
value: e2e-report.xml
- name: e2e-log-name
value: e2e-tests.log
- name: cluster-provision-log-name
value: cluster-provision.log
- name: enable-test-results-analysis
value: "true"
- name: artifact-browser-url
value: $(params.artifact-browser-url)
- name: store-pipeline-status
when:
- input: "$(tasks.test-metadata.results.pull-request-author)"
operator: notin
values: ["red-hat-konflux[bot]"]
taskRef:
resolver: git
params:
- name: url
value: https://github.com/konflux-ci/tekton-integration-catalog.git
- name: revision
value: main
- name: pathInRepo
value: tasks/store-pipeline-status/0.1/store-pipeline-status.yaml
params:
- name: oci-ref
value: "$(params.oci-container-repo):$(context.pipelineRun.name)"
- name: credentials-secret-name
value: "$(params.konflux-test-infra-secret)"
- name: pipelinerun-name
value: $(context.pipelineRun.name)
- name: pipeline-aggregate-status
value: $(tasks.status)