--- apiVersion: tekton.dev/v1 kind: Pipeline metadata: name: e2e-main-pipeline namespace: mtakac-tenant spec: params: - name: SNAPSHOT description: >- Snapshot JSON for the application under test. Primary containerImage is the non-instrumented UI digest; format-images resolves the parallel e2e[-on-pr]- and instrumented[-on-pr]- tags for the runner and UI under test. default: '{"components": [{"name":"konflux-ui", "containerImage": "quay.io/konflux_ui_qe/konflux-ui-tests:latest"}]}' type: string - name: konflux-test-infra-secret description: The name of secret where testing infrastructures credentials are stored. type: string # repository for storing task's artefacts, common for Konflux components # visible in dashboard https://app-artifact-browser.apps.rosa.konflux-qe.zmr9.p3.openshiftapps.com/ - name: oci-container-repo default: 'quay.io/konflux-test-storage/konflux-team/konflux-ui' description: The ORAS container used to store all test artifacts. - name: artifact-browser-url description: 'URL to the artifact browser deployment. If provided, a link will be added to PR comments.' default: 'https://app-artifact-browser.apps.rosa.konflux-qe.zmr9.p3.openshiftapps.com' type: string - name: github-credentials-secret description: 'Secret name containing GitHub token' default: 'github-credentials' type: string - name: cypress-credentials-secret description: 'Secret name containing Cypress credentials' default: 'cypress-credentials' type: string - name: cypress-cloud-secret description: 'Secret name containing Cypress Cloud credentials' default: 'cypress-cloud-credentials' type: string - name: slack-credentials-secret description: 'Secret name containing Slack credentials' default: 'slack-credentials' type: string - name: konflux-url description: 'Konflux UI base URL for pipeline run links in Slack notifications' default: 'https://konflux-ui.apps.stone-prd-rh01.pg1f.p1.openshiftapps.com' type: string - name: oci-credentials-secret description: 'Secret containing OCI registry credentials (oci-storage-dockerconfigjson key)' default: 'quay-repo' type: string - name: build-credentials-secret type: string default: build-credentials - name: ui-image-pull-secret description: >- Konflux image pull secret (IPS) that can pull the private SNAPSHOT UI image. Copied onto kind for deployment/proxy. type: string default: components-namespace-pull - name: spec-file description: 'Cypress test spec file(s) to run (comma-separated; override for a single test)' default: 'tests/component-lifecycle.spec.ts,tests/environment-config.spec.ts' type: string - name: job-type description: 'Type of job (pr-check, periodic-local, periodic-stage)' default: 'pr-check' type: string - name: skip-slack-notification description: 'Skip sending the Slack notification' default: 'false' type: string - name: test-image-repository description: >- Image repository without tag for e2e runner and instrumented UI builds. Must match the operator build pipeline outputs (e2e[-on-pr]-, instrumented[-on-pr]-). default: 'quay.io/redhat-user-workloads-stage/mtakac-tenant/slack-message-catalog' type: string - name: enable-coverage description: >- When true, run Cypress with coverage collection (cy:run:coverage). Coverage is stored in OCI artifacts and uploaded to Codecov when codecov-credentials-secret is present. default: 'true' type: string - name: codecov-credentials-secret description: 'Secret containing Codecov token (key: token). Optional; upload is skipped if missing.' default: 'codecov-credentials' type: string 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.4/test-metadata.yaml params: - name: SNAPSHOT value: $(params.SNAPSHOT) # Resolve parallel build tags. SNAPSHOT.containerImage is the primary # (non-instrumented) digest — e2e needs instrumented- / e2e-. - name: format-images runAfter: - test-metadata taskSpec: params: - name: test-image-repository type: string - name: git-revision type: string - name: test-event-type type: string results: - name: test-image type: string description: Cypress runner image (e2e[-on-pr]-) - name: ui-image type: string description: Instrumented UI image (instrumented[-on-pr]-) steps: - name: format image: registry.access.redhat.com/ubi9/ubi@sha256:4406835b776f05688a823ff532203587b9238510817645c9f37e0fdac1743b8c computeResources: limits: memory: 128Mi requests: cpu: 10m memory: 64Mi script: | #!/bin/bash set -euo pipefail event_type="$(params.test-event-type)" git_revision="$(params.git-revision)" repository="$(params.test-image-repository)" if [[ "${event_type}" == "pull_request" ]]; then e2e_tag="e2e-on-pr-${git_revision}" ui_tag="instrumented-on-pr-${git_revision}" else e2e_tag="e2e-${git_revision}" ui_tag="instrumented-${git_revision}" fi e2e_ref="${repository}:${e2e_tag}" ui_ref="${repository}:${ui_tag}" echo "E2E runner image: ${e2e_ref}" echo "Instrumented UI image: ${ui_ref}" printf '%s' "${e2e_ref}" > "$(results.test-image.path)" printf '%s' "${ui_ref}" > "$(results.ui-image.path)" params: - name: test-image-repository value: $(params.test-image-repository) - name: git-revision value: $(tasks.test-metadata.results.git-revision) - name: test-event-type value: $(tasks.test-metadata.results.test-event-type) - name: provision-kind-cluster runAfter: - test-metadata when: - input: '$(params.job-type)' operator: notin values: ['periodic-stage'] 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: $(params.konflux-test-infra-secret) - name: id value: $(context.pipelineRun.name) - name: cluster-access-secret-name value: kfg-$(context.pipelineRun.name) - name: tags value: 'owner=konflux-ui@redhat.com,project=Konflux,created-by=integration-pipeline,component=konflux-ui' - name: ownerName value: $(context.pipelineRun.name) - name: ownerUid value: $(context.pipelineRun.uid) - name: oci-ref value: $(params.oci-container-repo):$(context.pipelineRun.name) - name: oci-credentials value: $(params.oci-credentials-secret) # Operator-based install (KFLUXUI-1783). Injects the instrumented UI image # into deployment/proxy (operator has no UI image field; scaled down so it # cannot reconcile the stock image back). - name: deploy-konflux runAfter: - provision-kind-cluster - format-images when: - input: '$(params.job-type)' operator: notin values: ['periodic-stage'] taskRef: resolver: git params: - name: url value: https://github.com/konflux-ci/konflux-ui - name: revision value: main - name: pathInRepo value: .integration-tests/tasks/deploy-konflux-operator.yaml params: - name: cluster-access-secret value: kfg-$(context.pipelineRun.name) - name: oci-ref value: $(params.oci-container-repo):$(context.pipelineRun.name) - name: oci-credentials value: $(params.oci-credentials-secret) - name: build-credentials value: $(params.build-credentials-secret) - name: container-image value: $(tasks.format-images.results.ui-image) - name: pull-secret value: $(params.ui-image-pull-secret) - name: monitor-webhook-logs runAfter: - deploy-konflux when: - input: '$(params.job-type)' operator: notin values: ['periodic-stage'] taskRef: resolver: git params: - name: url value: https://github.com/konflux-ci/konflux-ui - name: revision value: main - name: pathInRepo value: .integration-tests/tasks/monitor-webhook-logs.yaml params: - name: monitoring-duration value: '5m' - name: run-e2e-konflux-ui runAfter: - deploy-konflux taskRef: resolver: git params: - name: url value: https://github.com/milantaky/konflux-ui - name: revision value: feat/slack-catalog - name: pathInRepo value: .integration-tests/tasks/run-e2e-konflux-ui.yaml params: - name: job-type value: '$(params.job-type)' # oci for storing artefacts - name: oci-ref value: $(params.oci-container-repo):$(context.pipelineRun.name) - name: oci-credentials value: $(params.oci-credentials-secret) - name: test-image value: $(tasks.format-images.results.test-image) - name: spec-file value: $(params.spec-file) - name: enable-coverage value: $(params.enable-coverage) - name: codecov-credentials-secret value: $(params.codecov-credentials-secret) - name: github-credentials-secret value: $(params.github-credentials-secret) - name: cypress-credentials-secret value: $(params.cypress-credentials-secret) - name: cypress-cloud-secret value: $(params.cypress-cloud-secret) - name: source-repo-url value: $(tasks.test-metadata.results.source-repo-url) - name: git-revision value: $(tasks.test-metadata.results.git-revision) - name: commit-info-branch value: $(tasks.test-metadata.results.source-repo-branch) - name: commit-info-author value: $(tasks.test-metadata.results.pull-request-author) - name: pull-request-number value: $(tasks.test-metadata.results.pull-request-number) - name: target-repo-url value: https://github.com/$(tasks.test-metadata.results.git-org)/$(tasks.test-metadata.results.git-repo) - name: pipeline-run-name value: $(context.pipelineRun.name) - name: job-url value: '$(params.konflux-url)/ns/$(context.pipelineRun.namespace)/applications/konflux-ui/pipelineruns/$(context.pipelineRun.name)' finally: - name: deprovision-kind-cluster when: - input: '$(params.job-type)' operator: notin values: ['periodic-stage'] 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: $(params.konflux-test-infra-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: $(params.oci-credentials-secret) - name: pipeline-aggregate-status value: '$(tasks.status)' # - name: pull-request-status-message # when: # - input: '$(params.job-type)' # operator: notin # values: ['periodic-stage', 'periodic-local'] # 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.2/pull-request-comment.yaml # params: # - name: test-name # value: '$(context.pipelineRun.name)' # - name: oci-container # value: '$(params.oci-container-repo):$(context.pipelineRun.name)' # - name: job-spec # value: '$(tasks.test-metadata.results.job-spec)' # - name: pipeline-aggregate-status # value: '$(tasks.status)' # - name: junit-report-name # value: e2e-report.xml # - name: enable-test-results-analysis # value: 'true' # - name: artifact-browser-url # value: '$(params.artifact-browser-url)' - name: send-slack-notification when: - input: '$(params.skip-slack-notification)' operator: notin values: ['true'] # - input: '$(params.job-type)' # operator: notin # values: ['pr-check'] taskRef: resolver: git params: - name: url value: https://github.com/konflux-ci/tekton-integration-catalog.git - name: revision value: main - name: pathInRepo value: tasks/slack-webhook-notification/0.1/slack-webhook-notification.yaml params: - name: message value: '$(tasks.run-e2e-konflux-ui.results.slack-message)' - name: secret-name value: $(params.slack-credentials-secret) - name: key-name value: webhook-url