1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-29 06:34:08 +00:00
catalog/task/golang-test/0.1
pratap0007 97d3859913 This patch splits golang-test task from the golang directory
Changes include:
  - moves the golang-test task to the task directory
  - copies and modifies readme file to golang-test task from golang directory
  - copies OWNERS file from golang directory
  - copies test directory from golang directory to golang-test task
  - changes the yaml filename to match the resource name

Issue : #386

Signed-off-by: Shiv Verma <shverma@redhat.com>
2020-07-13 13:41:58 +01:00
..
test This patch splits golang-test task from the golang directory 2020-07-13 13:41:58 +01:00
golang-test.yaml This patch splits golang-test task from the golang directory 2020-07-13 13:41:58 +01:00
OWNERS This patch splits golang-test task from the golang directory 2020-07-13 13:41:58 +01:00
README.md This patch splits golang-test task from the golang directory 2020-07-13 13:41:58 +01:00
tests.yaml This patch splits golang-test task from the golang directory 2020-07-13 13:41:58 +01:00

Golang Test

This task is a Golang task to test Go projects.

Install the task

kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/task/golang-test/0.1/golang-test.yaml

Parameters

  • package: base package to build in
  • packages: packages to test (default: ./cmd/...)
  • version: golang version to use for builds (default: latest)
  • flags: flags to use for go test command (default: -race -cover -v)
  • GOOS: operating system target (default: linux)
  • GOARCH: architecture target (default: amd64)
  • GO111MODULE: value of module support (default: auto)

Workspaces

  • source: A Workspace volume containing the source to build.

Usage

This TaskRun runs the Task to run unit-tests on tektoncd/pipeline.

apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  name: test-my-code
spec:
  taskRef:
    name: golang-test
  workspaces:
  - name: source
    persistentVolumeClaim:
      claimName: my-source
  params:
  - name: package
    value: github.com/tektoncd/pipeline
  - name: packages
    value: ./pkg/...