Skip to content

Commit

Permalink
re-add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonPowr committed Dec 6, 2023
1 parent bb9f548 commit 32cca18
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .tekton/timestamp-authority-1-0-gamma-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/tsa-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/timestamp-authority-1-0-gamma-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/tsa-unit-test:latest
- name: kind
value: task
resolver: bundles
workspaces:
- name: source
workspace: workspace
workspaces:
- name: workspace
- name: git-auth
Expand Down
24 changes: 24 additions & 0 deletions .tekton/tsa-unit-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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
CGO_ENABLED=0 go build -buildvcs=false -trimpath -o bin/timestamp-cli ./cmd/timestamp-cli
CGO_ENABLED=0 go build -buildvcs=false -trimpath -o bin/timestamp-server ./cmd/timestamp-server
go test ./...
# This file bundles the unit tests for the timestamp-authority.
# If any changes are made to this file, it must be pushed to Quay using the following command:
# 'tkn bundle push quay.io/securesign/tsa-unit-test:latest -f .tekton/tsa-unit-test.yaml'.
# This will generate a new SHA for the bundle.
# Ensure that this new SHA is updated in the pull and push pipeline files for each component.

0 comments on commit 32cca18

Please sign in to comment.