Skip to content

Commit

Permalink
wip: tekton task to run unit tests
Browse files Browse the repository at this point in the history
This adds a Task to run pipeline's unit tests

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
  • Loading branch information
vdemeester committed Jun 4, 2019
1 parent 75909bc commit e903fd1
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tekton/ci-unit-test-run.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: tekton.dev/v1alpha1
kind: PipelineResource
metadata:
name: tekton-pipelines
spec:
type: git
params:
- name: url
value: https://github.com/tektoncd/pipeline # REPLACE with your own fork
- name: revision
value: master # REPLACE with your own commit
---
apiVersion: tekton.dev/v1alpha1
kind: TaskRun
metadata:
name: unit-tests-run
spec:
taskRef:
name: unit-tests
inputs:
resources:
- name: source
resourceRef:
name: tekton-pipelines

26 changes: 26 additions & 0 deletions tekton/ci-unit-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
name: unit-tests
spec:
inputs:
params:
- name: package
description: package (and its children) under test
default: github.com/tektoncd/pipeline
resources:
- name: source
type: git
targetPath: src/${inputs.params.package}
#outputs: # coverage file
steps:
- name: unit-test
image: golang:1.12
workingdir: /workspace/src/${inputs.params.package}
command:
- go
args: ["test", "-v", "-cover", "./..."]
env:
- name: GOPATH
value: /workspace

0 comments on commit e903fd1

Please sign in to comment.