Skip to content

Commit e1eb748

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

File tree

1 file changed

+115
-0
lines changed

1 file changed

+115
-0
lines changed
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
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: '{"clusterClaim":{"cloud":"aws","owner":"test-rhoai","version":"4.20"}}'
67+
- name: prEventHeaders
68+
value: ""
69+
- name: run-test
70+
runAfter:
71+
- provision-ephemeral-cluster
72+
params:
73+
- name: kubeconfigSecretRef
74+
value: $(tasks.provision-ephemeral-cluster.results.secretRef)
75+
taskSpec:
76+
params:
77+
- name: kubeconfigSecretRef
78+
type: string
79+
description: "The secret that holds the Ephemeral Cluster kubeconfig"
80+
steps:
81+
- name: run-test
82+
image: registry.redhat.io/openshift4/ose-cli:4.13@sha256:73df37794ffff7de1101016c23dc623e4990810390ebdabcbbfa065214352c7c
83+
env:
84+
- name: KUBECONFIG_VALUE
85+
valueFrom:
86+
secretKeyRef:
87+
name: $(params.kubeconfigSecretRef)
88+
key: kubeconfig
89+
script: |
90+
#!/usr/bin/env bash
91+
set -eo pipefail
92+
93+
KUBECONFIG="$(mktemp kubeconfig.XXXXX)"
94+
trap 'rm -f "$KUBECONFIG"' EXIT
95+
96+
echo "$KUBECONFIG_VALUE" >"$KUBECONFIG"
97+
export KUBECONFIG
98+
99+
oc whoami
100+
finally:
101+
- name: deprovision-ephemeral-cluster
102+
taskRef:
103+
resolver: git
104+
params:
105+
- name: url
106+
value: https://github.com/openshift/konflux-tasks
107+
- name: revision
108+
value: main
109+
- name: pathInRepo
110+
value: tasks/deprovision-ephemeral-cluster/0.1/deprovision-ephemeral-cluster.yaml
111+
params:
112+
- name: testPlatformClusterClaimName
113+
value: $(tasks.provision-ephemeral-cluster.results.testPlatformClusterClaimName)
114+
- name: testPlatformClusterClaimNamespace
115+
value: $(tasks.provision-ephemeral-cluster.results.testPlatformClusterClaimNamespace)

0 commit comments

Comments
 (0)