Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(KONFLUX-3903): create pipeline to run tests in konflux #862

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
244 changes: 244 additions & 0 deletions integration-tests/pipelines/konflux-e2e-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: konflux-e2e-tests
spec:
description: |-
This pipeline automates the process of running end-to-end tests for Konflux
using a ROSA (Red Hat OpenShift Service on AWS) cluster. The pipeline provisions
the ROSA cluster, installs Konflux using the infra-deployments, runs the tests, collects artifacts,
and finally deprovisions the ROSA cluster.
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.'
flacatus marked this conversation as resolved.
Show resolved Hide resolved
default: ''
- name: ocp-version
description: 'The OpenShift version to use for the ephemeral cluster deployment.'
type: string
- name: konflux-test-infra-secret
description: The name of secret where testing infrastructures credentials are stored.
type: string
- name: cloud-credential-key
type: string
description: The key secret from konflux-test-infra-secret where all AWS ROSA configurations are stored.
- 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/integration-service'
description: The OCI container used to store all test artifacts.
- name: quality-dashboard-api
default: 'none'
description: 'Contains the url of the backend to send metrics for quality purposes.'
- 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.'
tasks:
- name: rosa-hcp-metadata
taskRef:
resolver: git
params:
- name: url
value: https://github.com/konflux-ci/konflux-qe-definitions.git
- name: revision
value: main
- name: pathInRepo
value: common/tasks/rosa/hosted-cp/rosa-hcp-metadata/rosa-hcp-metadata.yaml
- name: test-metadata
taskRef:
resolver: git
params:
- name: url
value: https://github.com/konflux-ci/konflux-qe-definitions.git
- name: revision
value: main
- name: pathInRepo
value: common/tasks/test-metadata/0.1/test-metadata.yaml
params:
- name: SNAPSHOT
value: $(params.SNAPSHOT)
- name: test-name
value: $(context.pipelineRun.name)
flacatus marked this conversation as resolved.
Show resolved Hide resolved
- name: create-oci-container
taskRef:
resolver: git
params:
- name: url
value: https://github.com/konflux-ci/konflux-qe-definitions.git
- name: revision
value: main
- name: pathInRepo
value: common/tasks/create-oci-artifact/0.1/create-oci-artifact.yaml
params:
- name: oci-container-repo
value: $(params.oci-container-repo)
- name: oci-container-tag
value: $(context.pipelineRun.name)
- name: provision-rosa
when:
- input: $(tasks.test-metadata.results.test-event-type)
dirgim marked this conversation as resolved.
Show resolved Hide resolved
operator: in
values: ["pull_request"]
runAfter:
- rosa-hcp-metadata
- test-metadata
- create-oci-container
taskRef:
resolver: git
params:
- name: url
value: https://github.com/konflux-ci/konflux-qe-definitions.git
- name: revision
value: main
- name: pathInRepo
value: common/tasks/rosa/hosted-cp/rosa-hcp-provision/rosa-hcp-provision.yaml
params:
- name: cluster-name
value: $(tasks.rosa-hcp-metadata.results.cluster-name)
- name: ocp-version
value: $(params.ocp-version)
- name: replicas
value: $(params.replicas)
- name: machine-type
value: $(params.machine-type)
- name: konflux-test-infra-secret
value: $(params.konflux-test-infra-secret)
- name: cloud-credential-key
value: $(params.cloud-credential-key)
- name: konflux-e2e-tests
timeout: 2h
when:
- input: $(tasks.test-metadata.results.test-event-type)
operator: in
values: ["pull_request"]
runAfter:
- provision-rosa
taskRef:
resolver: git
params:
- name: url
value: https://github.com/konflux-ci/e2e-tests.git
- name: revision
value: main
- name: pathInRepo
value: integration-tests/tasks/konflux-e2e-tests-task.yaml
hongweiliu17 marked this conversation as resolved.
Show resolved Hide resolved
params:
- name: test-name
value: $(context.pipelineRun.name)
- name: git-repo
value: $(tasks.test-metadata.results.git-repo)
- name: git-url
value: $(tasks.test-metadata.results.git-url)
- name: git-revision
value: $(tasks.test-metadata.results.git-revision)
- name: oras-container
value: $(tasks.create-oci-container.results.oci-container)
- name: job-spec
value: $(tasks.test-metadata.results.job-spec)
- name: ocp-login-command
value: $(tasks.provision-rosa.results.ocp-login-command)
- name: component-image
value: $(tasks.test-metadata.results.container-image)
finally:
- name: deprovision-rosa-collect-artifacts
when:
- input: $(tasks.test-metadata.results.test-event-type)
operator: in
values: ["pull_request"]
taskRef:
resolver: git
params:
- name: url
value: https://github.com/konflux-ci/konflux-qe-definitions.git
- name: revision
value: main
- name: pathInRepo
value: common/tasks/rosa/hosted-cp/rosa-hcp-deprovision/rosa-hcp-deprovision.yaml
params:
- name: test-name
value: $(context.pipelineRun.name)
flacatus marked this conversation as resolved.
Show resolved Hide resolved
- name: ocp-login-command
value: $(tasks.provision-rosa.results.ocp-login-command)
- name: oci-container
value: $(tasks.create-oci-container.results.oci-container)
- name: pull-request-author
value: $(tasks.test-metadata.results.pull-request-author)
- name: git-revision
value: $(tasks.test-metadata.results.git-revision)
- 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: cluster-name
value: $(tasks.rosa-hcp-metadata.results.cluster-name)
- name: konflux-test-infra-secret
value: $(params.konflux-test-infra-secret)
- name: cloud-credential-key
value: $(params.cloud-credential-key)
- name: pipeline-aggregate-status
value: $(tasks.status)
- name: quality-dashboard-upload
when:
- input: $(tasks.test-metadata.results.test-event-type)
operator: in
values: ["pull_request"]
taskRef:
resolver: git
params:
- name: url
value: https://github.com/konflux-ci/konflux-qe-definitions.git
- name: revision
value: main
- name: pathInRepo
value: common/tasks/quality-dashboard/0.1/quality-dashboard-upload.yaml
params:
- name: oci-container
value: $(tasks.create-oci-container.results.oci-container)
- name: quality-dashboard-api
value: $(params.quality-dashboard-api)
- name: pipeline-aggregate-status
value: $(tasks.status)
- name: test-event-type
value: $(tasks.test-metadata.results.test-event-type)
- name: pull-request-status-message
when:
- input: $(tasks.test-metadata.results.test-event-type)
operator: in
values: ["pull_request"]
taskRef:
resolver: git
params:
- name: url
value: https://github.com/konflux-ci/konflux-qe-definitions.git
- name: revision
value: main
- name: pathInRepo
value: common/tasks/pull-request-comment/0.1/pull-request-comment.yaml
params:
- name: test-name
value: $(context.pipelineRun.name)
- name: oci-container
value: $(tasks.create-oci-container.results.oci-container)
- 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)
Loading