-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
81 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
315 changes: 80 additions & 235 deletions
315
integration-tests/pipelines/konflux-e2e-tests-pipeline.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,253 +1,98 @@ | ||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
apiVersion: tekton.dev/v1 | ||
kind: Pipeline | ||
metadata: | ||
name: konflux-e2e-tests | ||
name: provision-cluster | ||
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. | ||
description: | | ||
An integration test which provisions an ephemeral Hypershift cluster and obtains a kubeconfig. | ||
params: | ||
- name: SNAPSHOT | ||
description: 'The JSON string representing the snapshot of the application under test.' | ||
- description: Snapshot of the application | ||
name: SNAPSHOT | ||
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: '' | ||
- 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 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/e2e-tests' | ||
description: The ORAS 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.' | ||
- name: container-image | ||
default: 'quay.io/redhat-user-workloads/konflux-qe-team-tenant/konflux-e2e/konflux-e2e-tests:latest' | ||
description: 'Konflux e2e tests container. Contain the ginkgo binary to run the e2e tests in any Konflux component.' | ||
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 | ||
- name: provision-eaas-space | ||
taskRef: | ||
resolver: git | ||
params: | ||
- name: url | ||
value: https://github.com/konflux-ci/konflux-qe-definitions.git | ||
value: https://github.com/konflux-ci/build-definitions.git | ||
- name: revision | ||
value: main | ||
- name: pathInRepo | ||
value: common/tasks/test-metadata/0.1/test-metadata.yaml | ||
value: task/eaas-provision-space/0.1/eaas-provision-space.yaml | ||
params: | ||
- name: SNAPSHOT | ||
value: $(params.SNAPSHOT) | ||
- name: test-name | ||
- name: ownerName | ||
value: $(context.pipelineRun.name) | ||
- 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)" | ||
operator: in | ||
values: ["pull_request"] | ||
- name: ownerUid | ||
value: $(context.pipelineRun.uid) | ||
- name: provision-cluster | ||
runAfter: | ||
- rosa-hcp-metadata | ||
- create-oci-container | ||
- 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/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: 3h | ||
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 | ||
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)" | ||
- name: container-image | ||
value: "$(params.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)" | ||
- 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: test-name | ||
value: "$(context.pipelineRun.name)" | ||
- 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)" | ||
- provision-eaas-space | ||
taskSpec: | ||
results: | ||
- name: clusterName | ||
value: "$(steps.create-cluster.results.clusterName)" | ||
volumes: | ||
- name: credentials | ||
emptyDir: {} | ||
steps: | ||
- name: get-supported-versions | ||
ref: | ||
resolver: git | ||
params: | ||
- name: url | ||
value: https://github.com/konflux-ci/build-definitions.git | ||
- name: revision | ||
value: main | ||
- name: pathInRepo | ||
value: stepactions/eaas-get-supported-ephemeral-cluster-versions/0.1/eaas-get-supported-ephemeral-cluster-versions.yaml | ||
params: | ||
- name: eaasSpaceSecretRef | ||
value: $(tasks.provision-eaas-space.results.secretRef) | ||
- name: pick-version | ||
ref: | ||
resolver: git | ||
params: | ||
- name: url | ||
value: https://github.com/konflux-ci/build-definitions.git | ||
- name: revision | ||
value: main | ||
- name: pathInRepo | ||
value: stepactions/eaas-get-latest-openshift-version-by-prefix/0.1/eaas-get-latest-openshift-version-by-prefix.yaml | ||
params: | ||
- name: prefix | ||
value: "$(steps.get-supported-versions.results.versions[0])." | ||
- name: create-cluster | ||
ref: | ||
resolver: git | ||
params: | ||
- name: url | ||
value: https://github.com/konflux-ci/build-definitions.git | ||
- name: revision | ||
value: main | ||
- name: pathInRepo | ||
value: stepactions/eaas-create-ephemeral-cluster-hypershift-aws/0.1/eaas-create-ephemeral-cluster-hypershift-aws.yaml | ||
params: | ||
- name: eaasSpaceSecretRef | ||
value: $(tasks.provision-eaas-space.results.secretRef) | ||
- name: version | ||
value: "$(steps.pick-version.results.version)" | ||
- name: get-kubeconfig | ||
ref: | ||
resolver: git | ||
params: | ||
- name: url | ||
value: https://github.com/konflux-ci/build-definitions.git | ||
- name: revision | ||
value: main | ||
- name: pathInRepo | ||
value: stepactions/eaas-get-ephemeral-cluster-credentials/0.1/eaas-get-ephemeral-cluster-credentials.yaml | ||
params: | ||
- name: eaasSpaceSecretRef | ||
value: $(tasks.provision-eaas-space.results.secretRef) | ||
- name: clusterName | ||
value: "$(steps.create-cluster.results.clusterName)" | ||
- name: credentials | ||
value: credentials |