Skip to content

Commit df5ffa4

Browse files
committed
Test konflux integration test
Signed-off-by: Arthy Loganathan <aloganat@redhat.com>
1 parent 8e57ef2 commit df5ffa4

File tree

1 file changed

+121
-0
lines changed

1 file changed

+121
-0
lines changed
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
---
2+
apiVersion: tekton.dev/v1
3+
kind: Pipeline
4+
metadata:
5+
name: testops-e2e-test
6+
spec:
7+
description: |
8+
An integration test which provisions an ephemeral Hypershift cluster, deploys rhoai
9+
from a Konflux snapshot and runs the e2e tests against it.
10+
params:
11+
- description: Snapshot of the application
12+
name: SNAPSHOT
13+
default: '{"components": [{"name":"test-operator", "containerImage": "quay.io/rhoai/rhoai-fbc-fragment:rhoai-3.3"}]}'
14+
type: string
15+
tasks:
16+
- name: parse-metadata
17+
taskRef:
18+
resolver: git
19+
params:
20+
- name: url
21+
value: https://github.com/konflux-ci/integration-examples
22+
- name: revision
23+
value: main
24+
- name: pathInRepo
25+
value: tasks/test_metadata.yaml
26+
params:
27+
- name: SNAPSHOT
28+
value: $(params.SNAPSHOT)
29+
- name: test-task
30+
runAfter:
31+
- parse-metadata
32+
params:
33+
- name: fbc-image
34+
value: "$(tasks.parse-metadata.results.component-container-image)"
35+
taskSpec:
36+
params:
37+
- name: fbc-image
38+
type: string
39+
steps:
40+
- name: run-script
41+
image: quay.io/openshift/origin-cli:latest
42+
script: |
43+
echo -e "$(params.fbc-image)"
44+
- name: provision-ephemeral-cluster
45+
taskRef:
46+
resolver: git
47+
params:
48+
- name: url
49+
value: https://github.com/openshift/konflux-tasks
50+
- name: revision
51+
value: main
52+
- name: pathInRepo
53+
value: tasks/provision-ephemeral-cluster/0.1/provision-ephemeral-cluster.yaml
54+
params:
55+
- name: ownerName
56+
value: $(context.pipelineRun.name)
57+
- name: ownerUid
58+
value: $(context.pipelineRun.uid)
59+
- name: workflow
60+
value: ipi-aws
61+
- name: clusterProfile
62+
value: my-cluster-profile
63+
- name: releases
64+
value: '{"initial":{"integration":{"name":"4.20","namespace":"ocp"}},"latest":{"integration":{"name":"4.20","namespace":"ocp"}}}'
65+
- name: prEventPayload
66+
value: ""
67+
- name: prEventHeaders
68+
value: ""
69+
- name: cloud
70+
value: aws
71+
- name: owner
72+
value: test-rhoai
73+
- name: version
74+
value: "4.20"
75+
- name: run-test
76+
runAfter:
77+
- provision-ephemeral-cluster
78+
params:
79+
- name: kubeconfigSecretRef
80+
value: $(tasks.provision-ephemeral-cluster.results.secretRef)
81+
taskSpec:
82+
params:
83+
- name: kubeconfigSecretRef
84+
type: string
85+
description: "The secret that holds the Ephemeral Cluster kubeconfig"
86+
steps:
87+
- name: run-test
88+
image: registry.redhat.io/openshift4/ose-cli:4.13@sha256:73df37794ffff7de1101016c23dc623e4990810390ebdabcbbfa065214352c7c
89+
env:
90+
- name: KUBECONFIG_VALUE
91+
valueFrom:
92+
secretKeyRef:
93+
name: $(params.kubeconfigSecretRef)
94+
key: kubeconfig
95+
script: |
96+
#!/usr/bin/env bash
97+
set -eo pipefail
98+
99+
KUBECONFIG="$(mktemp kubeconfig.XXXXX)"
100+
trap 'rm -f "$KUBECONFIG"' EXIT
101+
102+
echo "$KUBECONFIG_VALUE" >"$KUBECONFIG"
103+
export KUBECONFIG
104+
105+
oc whoami
106+
finally:
107+
- name: deprovision-ephemeral-cluster
108+
taskRef:
109+
resolver: git
110+
params:
111+
- name: url
112+
value: https://github.com/openshift/konflux-tasks
113+
- name: revision
114+
value: main
115+
- name: pathInRepo
116+
value: tasks/deprovision-ephemeral-cluster/0.1/deprovision-ephemeral-cluster.yaml
117+
params:
118+
- name: testPlatformClusterClaimName
119+
value: $(tasks.provision-ephemeral-cluster.results.testPlatformClusterClaimName)
120+
- name: testPlatformClusterClaimNamespace
121+
value: $(tasks.provision-ephemeral-cluster.results.testPlatformClusterClaimNamespace)

0 commit comments

Comments
 (0)