Skip to content

Commit

Permalink
Add nightly e2e tests for operator on ppc64le
Browse files Browse the repository at this point in the history
Signed-off-by: Siddhesh Ghadi <[email protected]>
  • Loading branch information
svghadi committed Mar 22, 2021
1 parent 5109bfb commit 368dde0
Show file tree
Hide file tree
Showing 7 changed files with 216 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ resources:
- pipeline-nightly-test
- triggers-nightly-test
- cli-nightly-test
- operator-nightly-test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cron Job to run nightly operator e2e tests on ppc64le hardware.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: nightly-test-trigger
spec:
schedule: "0 5 * * *"
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
containers:
- name: trigger
env:
- name: SINK_URL
value: "http://el-test-nightly.default.svc.cluster.local:8080"
- name: TARGET_PROJECT
value: "operator"
- name: NAMESPACE
value: "bastion-p"
- name: REGISTRY
value: "ppc64le-cluster.bastion-p.svc.cluster.local:443"
- name: TARGET_ARCH
value: "ppc64le"
- name: REMOTE_SECRET_NAME
value: "ppc64le-kubeconfig"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bases:
- ../../../../bases/nightly-tests
patchesStrategicMerge:
- cronjob.yaml
nameSuffix: "-operator-ppc64le"
12 changes: 12 additions & 0 deletions tekton/resources/nightly-tests/eventlistener.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ spec:
- ref: trigger-to-deploy-test-tekton-project
template:
ref: tekton-cli-nightly-test-ppc64le
- name: operator-nightly-test-trigger-ppc64le
interceptors:
- cel:
filter: >-
'trigger-template' in body &&
body['trigger-template'] == 'operator' &&
'arch' in body.params.target &&
body.params.target.arch == 'ppc64le'
bindings:
- ref: trigger-to-deploy-test-tekton-project
template:
ref: tekton-operator-nightly-test-ppc64le
---
apiVersion: triggers.tekton.dev/v1alpha1
kind: TriggerBinding
Expand Down
1 change: 1 addition & 0 deletions tekton/resources/nightly-tests/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ resources:
- serviceaccount.yaml
- triggers-deploy-test-ppc64le-template.yaml
- cli-deploy-test-ppc64le-template.yaml
- operator-deploy-test-ppc64le-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
# Copyright 2021 The Tekton Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: triggers.tekton.dev/v1alpha1
kind: TriggerTemplate
metadata:
name: tekton-operator-nightly-test-ppc64le
spec:
params:
- name: containerRegistry
- name: targetArch
- name: namespace
- name: remoteSecret
resourcetemplates:
- apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
generateName: tekton-operator-$(tt.params.targetArch)-nightly-run-
namespace: $(tt.params.namespace)
spec:
timeout: 2h
workspaces:
# this workspace will be used to share info between tasks
- name: shared-workspace
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
# this workspace will be used to store k8s config
- name: k8s-config
secret:
secretName: $(tt.params.remoteSecret)
# this workspace will be used to store registry credentials
- name: registry-credentials
secret:
secretName: registry-credentials
# this workspace will be used to store registry self-signed certificate
- name: registry-certificate
secret:
secretName: registry-certificate
pipelineSpec:
workspaces:
- name: shared-workspace
- name: k8s-config
- name: registry-credentials
- name: registry-certificate
params:
- name: container-registry
- name: target-arch
tasks:
- name: git-clone-operator
taskRef:
name: git-clone
params:
- name: url
value: https://github.com/tektoncd/operator
- name: revision
value: main
- name: subdirectory
value: src/github.com/tektoncd/operator
workspaces:
- name: output
workspace: shared-workspace
subPath: source-code
- name: e2e-test-operator
runAfter: [git-clone-operator]
taskSpec:
params:
- name: container-registry
- name: target-arch
workspaces:
- name: k8s-config
description: workspace to get k8s config file
mountPath: /root/.kube
- name: registry-credentials
description: workspace to get registry credentials
mountPath: /tekton/home/.docker
- name: registry-certificate
description: workspace to get registry self-signed certificate
mountPath: /opt/ssl/certs
- name: source-code
description: workspace with source code for tekton component
steps:
- name: run-e2e-tests
image: gcr.io/tekton-releases/dogfooding/test-runner:latest
workingdir: $(workspaces.source-code.path)/src/github.com/tektoncd/operator
env:
- name: GOPATH
value: /workspace
- name: KUBECONFIG
value: /root/.kube/config
- name: SSL_CERT_FILE
value: /opt/ssl/certs/registry.crt
- name: PLATFORM
value: linux/$(params.target-arch)
- name: KO_DOCKER_REPO
value: $(params.container-registry)
- name: E2E_DEBUG
value: "true"
command:
- /bin/bash
args:
- -ce
- |
test/e2e-tests.sh
params:
- name: container-registry
value: $(params.container-registry)
- name: target-arch
value: $(params.target-arch)
workspaces:
- name: k8s-config
workspace: k8s-config
- name: registry-credentials
workspace: registry-credentials
- name: registry-certificate
workspace: registry-certificate
- name: source-code
workspace: shared-workspace
subPath: source-code
retries: 2
finally:
- name: cleanup
taskSpec:
workspaces:
- name: k8s-config
description: workspace to get k8s config file
mountPath: /root/.kube
- name: source-code
description: workspace with source code for tekton component
steps:
- name: cleanup-operator
image: gcr.io/tekton-releases/dogfooding/test-runner:latest
workingdir: $(workspaces.source-code.path)/src/github.com/tektoncd/operator
env:
- name: GOPATH
value: /workspace
- name: KUBECONFIG
value: /root/.kube/config
command:
- /bin/bash
args:
- -ce
- |
make clean
workspaces:
- name: k8s-config
workspace: k8s-config
- name: source-code
workspace: shared-workspace
subPath: source-code
retries: 2
params:
- name: container-registry
value: $(tt.params.containerRegistry)
- name: target-arch
value: $(tt.params.targetArch)

0 comments on commit 368dde0

Please sign in to comment.