Skip to content

Commit

Permalink
re-add unit tests (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonPowr authored Dec 8, 2023
1 parent 4653c3b commit 556a5d4
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .tekton/cosign-cli-2-2-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,21 @@ spec:
operator: in
values:
- "false"
- name: run-unit-test
runAfter:
- prefetch-dependencies
taskRef:
params:
- name: name
value: go-unit-test
- name: bundle
value: quay.io/securesign/cosign-unit-test:latest
- name: kind
value: task
resolver: bundles
workspaces:
- name: source
workspace: workspace
workspaces:
- name: workspace
- name: git-auth
Expand Down
15 changes: 15 additions & 0 deletions .tekton/cosign-cli-2-2-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,21 @@ spec:
operator: in
values:
- "false"
- name: run-unit-test
runAfter:
- prefetch-dependencies
taskRef:
params:
- name: name
value: go-unit-test
- name: bundle
value: quay.io/securesign/cosign-unit-test:latest
- name: kind
value: task
resolver: bundles
workspaces:
- name: source
workspace: workspace
workspaces:
- name: workspace
- name: git-auth
Expand Down
20 changes: 20 additions & 0 deletions .tekton/cosign-unit-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: go-unit-test
annotations:
tekton.dev/title: "Go Unit Test Task"
spec:
workspaces:
- name: source
steps:
- name: run-tests
image: registry.access.redhat.com/ubi9/go-toolset@sha256:c3a9c5c7fb226f6efcec2424dd30c38f652156040b490c9eca5ac5b61d8dc3ca
workingDir: $(workspaces.source.path)/source
script: |
#!/usr/bin/env sh
go test ./...
# This file bundles the unit tests for cosign.
# If any changes are made to this file, it must be pushed to Quay using the following command:
# 'tkn bundle push quay.io/securesign/cosign-unit-test:latest -f .tekton/cosign-unit-test.yaml'.

0 comments on commit 556a5d4

Please sign in to comment.