Skip to content

Commit b047db9

Browse files
authored
SECURESIGN-185 | Add tests to all pipelines (#65)
* re add unit tests * ignore versions directory * update test path
1 parent 241f8bb commit b047db9

3 files changed

+50
-0
lines changed

.tekton/gitsign-cli-0-8-pull-request.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,21 @@ spec:
383383
operator: in
384384
values:
385385
- "false"
386+
- name: run-unit-test
387+
runAfter:
388+
- prefetch-dependencies
389+
taskRef:
390+
params:
391+
- name: name
392+
value: go-unit-test
393+
- name: bundle
394+
value: quay.io/securesign/gitsign-unit-test:latest
395+
- name: kind
396+
value: task
397+
resolver: bundles
398+
workspaces:
399+
- name: source
400+
workspace: workspace
386401
workspaces:
387402
- name: workspace
388403
- name: git-auth

.tekton/gitsign-cli-0-8-push.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,21 @@ spec:
380380
operator: in
381381
values:
382382
- "false"
383+
- name: run-unit-test
384+
runAfter:
385+
- prefetch-dependencies
386+
taskRef:
387+
params:
388+
- name: name
389+
value: go-unit-test
390+
- name: bundle
391+
value: quay.io/securesign/gitsign-unit-test:latest
392+
- name: kind
393+
value: task
394+
resolver: bundles
395+
workspaces:
396+
- name: source
397+
workspace: workspace
383398
workspaces:
384399
- name: workspace
385400
- name: git-auth

.tekton/gitsign-unit-test.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: tekton.dev/v1beta1
2+
kind: Task
3+
metadata:
4+
name: go-unit-test
5+
annotations:
6+
tekton.dev/title: "Go Unit Test Task"
7+
spec:
8+
workspaces:
9+
- name: source
10+
steps:
11+
- name: run-tests
12+
image: registry.access.redhat.com/ubi9/go-toolset@sha256:c3a9c5c7fb226f6efcec2424dd30c38f652156040b490c9eca5ac5b61d8dc3ca
13+
workingDir: $(workspaces.source.path)/source
14+
script: |
15+
#!/usr/bin/env sh
16+
go test $(go list ./... | grep -v github.com/sigstore/gitsign/pkg/version)
17+
18+
# This file bundles the unit tests for gitsign.
19+
# If any changes are made to this file, it must be pushed to Quay using the following command:
20+
# 'tkn bundle push quay.io/securesign/gitsign-unit-test:latest -f .tekton/gitsign-unit-test.yaml'.

0 commit comments

Comments
 (0)