1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-22 06:02:51 +00:00
catalog/task/golang-test/0.2
vinamra28 d65ed39437 Use git-clone 0.7 instead of latest in Tasks' test
With git-clone version 0.8, Task now runs as non-root and with this change I
guess it's not working well with our GKE clusters and tests started
failing in nightly runs.

For now changing the version of git-clone to use 0.7 so that for now CI
is unblocked 😅

Signed-off-by: vinamra28 <jvinamra776@gmail.com>
2022-09-27 15:05:12 +02:00
..
tests Use git-clone 0.7 instead of latest in Tasks' test 2022-09-27 15:05:12 +02:00
golang-test.yaml Don't omit params.context in source path construction 2021-12-20 16:49:55 +00:00
README.md [TEP-0110] Update Tekton Catalog installation instructions 2022-08-16 16:25:52 +01:00

Golang Test

This task is a Golang task to test Go projects.

Install the task

kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/golang-test/0.2/raw

Parameters

  • package: base package to build in
  • packages: packages to test (default: ./cmd/...)
  • context: path to the directory to use as context (default: .)
  • 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)
  • GOCACHE: value for go caching path (default: "")
  • GOMODCACHE: value for go module caching path (default: "")

Workspaces

  • source: A Workspace containing the source to build.

Platforms

The Task can be run on linux/amd64, linux/s390x and linux/ppc64le platforms.

Specify value for GOARCH parameter according to the desired target architecture. Do not use -race flag in flags parameter for linux/s390x platform.

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/...