Skip to content

Commit

Permalink
Migrating tekton pipeline integration from prow to tekton
Browse files Browse the repository at this point in the history
This PR allows us to run the tektonCD/pipeline's integration tests on the tekton dogfooding cluster using a pipeline instead of a prow job.

Before merging, the tekton dogfooding cluster needs to be updated as follows:
1. Set up a node pool similar to prow cluster’s “n2-standard-4-kind” node pool.
    - ie. Add same Taints, auto scaling 0-24, us-central1 etc.
2. create a secret for test-account (same as prow) to store the service-account.json credentials
  • Loading branch information
chitrangpatel committed Nov 26, 2022
1 parent 39e5a63 commit 9ac20e9
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 0 deletions.
1 change: 1 addition & 0 deletions tekton/ci/jobs/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ resources:
- tekton-yamllint.yaml
- tekton-github-tasks-completed.yaml
- tekton-golang-coverage.yaml
- tekton-integration-tests.yaml
114 changes: 114 additions & 0 deletions tekton/ci/repos/pipeline/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,117 @@
value: post-tekton-pipeline-go-coverage
- name: uploadGcsBucket
value: tekton-prow
- apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
generateName: run-integration-tests-
labels:
prow.k8s.io/build-id: $(tt.params.buildUUID)
tekton.dev/source-event-id: $(tt.params.sourceEventId)
tekton.dev/check-name: pull-tekton-pipeline-integration-tests-using-tekton
tekton.dev/kind: ci
tekton.dev/pr-number: $(tt.params.pullRequestNumber)
annotations:
tekton.dev/gitRevision: "$(tt.params.gitRevision)"
tekton.dev/gitURL: "$(tt.params.gitRepository)"
spec:
pipelineRef:
name: integration-test-pipeline
workspaces:
- name: source
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
- name: test-account
secret:
secretName: test-account
params:
- name: jobName
value: pull-tekton-pipeline-integration-tests-using-tekton
- name: gitHubCommand
value: $(tt.params.gitHubCommand)
- name: package
value: $(tt.params.package)
- name: pullRequestNumber
value: $(tt.params.pullRequestNumber)
- name: pullRequestBaseRef
value: $(tt.params.pullRequestBaseRef)
- name: e2eClusterRegion
value: "us-central1"
- name: k8sVersion
value: "v1.23.x"
- name: nodes
value: "3"
- name: e2eScript
value: "./test/e2e-tests.sh"
- name: e2eEnv
value: "./test/e2e-tests-kind-prow.env"
podTemplate:
nodeSelector:
cloud.google.com/gke-nodepool: "n2-standard-4-kind"
tolerations:
- key: kind-only
operator: Equal
value: "true"
effect: NoSchedule
- apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
generateName: run-alpha-integration-tests-
labels:
prow.k8s.io/build-id: $(tt.params.buildUUID)
tekton.dev/source-event-id: $(tt.params.sourceEventId)
tekton.dev/check-name: pull-tekton-pipeline-alpha-integration-tests-using-tekton
tekton.dev/kind: ci
tekton.dev/pr-number: $(tt.params.pullRequestNumber)
annotations:
tekton.dev/gitRevision: "$(tt.params.gitRevision)"
tekton.dev/gitURL: "$(tt.params.gitRepository)"
spec:
pipelineRef:
name: integration-test-pipeline
workspaces:
- name: source
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
- name: test-account
secret:
secretName: test-account
params:
- name: jobName
value: pull-tekton-pipeline-alpha-integration-tests-using-tekton
- name: gitHubCommand
value: $(tt.params.gitHubCommand)
- name: package
value: $(tt.params.package)
- name: pullRequestNumber
value: $(tt.params.pullRequestNumber)
- name: pullRequestBaseRef
value: $(tt.params.pullRequestBaseRef)
- name: e2eClusterRegion
value: "us-central1"
- name: k8sVersion
value: "v1.23.x"
- name: nodes
value: "3"
- name: e2eScript
value: "./test/e2e-tests.sh"
- name: e2eEnv
value: "./test/e2e-tests-kind-prow-alpha.env"
podTemplate:
nodeSelector:
cloud.google.com/gke-nodepool: "n2-standard-4-kind"
tolerations:
- key: kind-only
operator: Equal
value: "true"
effect: NoSchedule

0 comments on commit 9ac20e9

Please sign in to comment.