From 7b9eb5dda174b7ef08959dcc5a9f6909cf794266 Mon Sep 17 00:00:00 2001 From: JasonPowr <20076537@mail.wit.ie> Date: Thu, 19 Oct 2023 15:11:06 +0100 Subject: [PATCH 1/4] update unit test task paths --- .tekton/timestamp-authority-pull-request.yaml | 2 +- .tekton/timestamp-authority-push.yaml | 2 +- .tekton/tsa-unit-test.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.tekton/timestamp-authority-pull-request.yaml b/.tekton/timestamp-authority-pull-request.yaml index 54ce1da9..fdee3ae7 100644 --- a/.tekton/timestamp-authority-pull-request.yaml +++ b/.tekton/timestamp-authority-pull-request.yaml @@ -379,7 +379,7 @@ spec: - name: name value: go-unit-test - name: bundle - value: quay.io/securesign/tsa-unit-test@sha256:032d9bf967a0da0d34d7303006c894bf69fddb186d1b9e7a00b286fee22bd91e + value: quay.io/securesign/tsa-unit-test@sha256:8a1900ca9afdf161004f5f1b21cbca4ba063445c578d4aff63a7d067016fc2a8 - name: kind value: task resolver: bundles diff --git a/.tekton/timestamp-authority-push.yaml b/.tekton/timestamp-authority-push.yaml index f4f90d50..244b2044 100644 --- a/.tekton/timestamp-authority-push.yaml +++ b/.tekton/timestamp-authority-push.yaml @@ -376,7 +376,7 @@ spec: - name: name value: go-unit-test - name: bundle - value: quay.io/securesign/tsa-unit-test@sha256:032d9bf967a0da0d34d7303006c894bf69fddb186d1b9e7a00b286fee22bd91e + value: quay.io/securesign/tsa-unit-test@sha256:8a1900ca9afdf161004f5f1b21cbca4ba063445c578d4aff63a7d067016fc2a8 - name: kind value: task resolver: bundles diff --git a/.tekton/tsa-unit-test.yaml b/.tekton/tsa-unit-test.yaml index 5f8b29bf..1030ab92 100644 --- a/.tekton/tsa-unit-test.yaml +++ b/.tekton/tsa-unit-test.yaml @@ -9,8 +9,8 @@ spec: - name: source steps: - name: run-tests - image: registry.access.redhat.com/ubi9/go-toolset@sha256:e91cbbd0b659498d029dd43e050c8a009c403146bfba22cbebca8bcd0ee7925f - workingDir: $(workspaces.source.path) + image: registry.access.redhat.com/ubi9/go-toolset@sha256:7e49e105a854749d67e5e02fb4069b48bd50445098c780b7f808cc351dee2589 + workingDir: $(workspaces.source.path)/source script: | #!/usr/bin/env sh git config --global --add safe.directory /workspace/source From deeee0a79ad1e0b2d25712020a5cbddb64727bbc Mon Sep 17 00:00:00 2001 From: JasonPowr <20076537@mail.wit.ie> Date: Thu, 19 Oct 2023 15:57:21 +0100 Subject: [PATCH 2/4] tests: small change to test --- .tekton/timestamp-authority-pull-request.yaml | 2 +- .tekton/timestamp-authority-push.yaml | 2 +- .tekton/tsa-unit-test.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.tekton/timestamp-authority-pull-request.yaml b/.tekton/timestamp-authority-pull-request.yaml index fdee3ae7..bfd6b0d4 100644 --- a/.tekton/timestamp-authority-pull-request.yaml +++ b/.tekton/timestamp-authority-pull-request.yaml @@ -379,7 +379,7 @@ spec: - name: name value: go-unit-test - name: bundle - value: quay.io/securesign/tsa-unit-test@sha256:8a1900ca9afdf161004f5f1b21cbca4ba063445c578d4aff63a7d067016fc2a8 + value: quay.io/securesign/tsa-unit-test@sha256:d8a44665dbf0fc4f657970a15727f7c209098924c07ece98794a1f1e0252d87b - name: kind value: task resolver: bundles diff --git a/.tekton/timestamp-authority-push.yaml b/.tekton/timestamp-authority-push.yaml index 244b2044..df257da7 100644 --- a/.tekton/timestamp-authority-push.yaml +++ b/.tekton/timestamp-authority-push.yaml @@ -376,7 +376,7 @@ spec: - name: name value: go-unit-test - name: bundle - value: quay.io/securesign/tsa-unit-test@sha256:8a1900ca9afdf161004f5f1b21cbca4ba063445c578d4aff63a7d067016fc2a8 + value: quay.io/securesign/tsa-unit-test@sha256:d8a44665dbf0fc4f657970a15727f7c209098924c07ece98794a1f1e0252d87b - name: kind value: task resolver: bundles diff --git a/.tekton/tsa-unit-test.yaml b/.tekton/tsa-unit-test.yaml index 1030ab92..a1862d9e 100644 --- a/.tekton/tsa-unit-test.yaml +++ b/.tekton/tsa-unit-test.yaml @@ -13,7 +13,7 @@ spec: workingDir: $(workspaces.source.path)/source script: | #!/usr/bin/env sh - git config --global --add safe.directory /workspace/source + git config --global --add safe.directory $(workspaces.source.path)/source CGO_ENABLED=0 go build -trimpath -o bin/timestamp-cli ./cmd/timestamp-cli CGO_ENABLED=0 go build -trimpath -o bin/timestamp-server ./cmd/timestamp-server go test ./... From 2ef1e312c7b6c740b9c36541efca437d6102d357 Mon Sep 17 00:00:00 2001 From: JasonPowr <20076537@mail.wit.ie> Date: Thu, 19 Oct 2023 16:08:42 +0100 Subject: [PATCH 3/4] rm env in script --- .tekton/timestamp-authority-pull-request.yaml | 2 +- .tekton/timestamp-authority-push.yaml | 2 +- .tekton/tsa-unit-test.yaml | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.tekton/timestamp-authority-pull-request.yaml b/.tekton/timestamp-authority-pull-request.yaml index bfd6b0d4..e046ff88 100644 --- a/.tekton/timestamp-authority-pull-request.yaml +++ b/.tekton/timestamp-authority-pull-request.yaml @@ -379,7 +379,7 @@ spec: - name: name value: go-unit-test - name: bundle - value: quay.io/securesign/tsa-unit-test@sha256:d8a44665dbf0fc4f657970a15727f7c209098924c07ece98794a1f1e0252d87b + value: quay.io/securesign/tsa-unit-test@sha256:6868c35f5840966bc510aed6ca42bf8dc02954d662a721d98b2dd5b04326c1f6 - name: kind value: task resolver: bundles diff --git a/.tekton/timestamp-authority-push.yaml b/.tekton/timestamp-authority-push.yaml index df257da7..95257635 100644 --- a/.tekton/timestamp-authority-push.yaml +++ b/.tekton/timestamp-authority-push.yaml @@ -376,7 +376,7 @@ spec: - name: name value: go-unit-test - name: bundle - value: quay.io/securesign/tsa-unit-test@sha256:d8a44665dbf0fc4f657970a15727f7c209098924c07ece98794a1f1e0252d87b + value: quay.io/securesign/tsa-unit-test@sha256:6868c35f5840966bc510aed6ca42bf8dc02954d662a721d98b2dd5b04326c1f6 - name: kind value: task resolver: bundles diff --git a/.tekton/tsa-unit-test.yaml b/.tekton/tsa-unit-test.yaml index a1862d9e..446f3efc 100644 --- a/.tekton/tsa-unit-test.yaml +++ b/.tekton/tsa-unit-test.yaml @@ -10,14 +10,14 @@ spec: steps: - name: run-tests image: registry.access.redhat.com/ubi9/go-toolset@sha256:7e49e105a854749d67e5e02fb4069b48bd50445098c780b7f808cc351dee2589 - workingDir: $(workspaces.source.path)/source + workingDir: $(workspaces.source.path) script: | #!/usr/bin/env sh - git config --global --add safe.directory $(workspaces.source.path)/source - CGO_ENABLED=0 go build -trimpath -o bin/timestamp-cli ./cmd/timestamp-cli - CGO_ENABLED=0 go build -trimpath -o bin/timestamp-server ./cmd/timestamp-server - go test ./... - + git config --global --add safe.directory $(workspaces.source.path) + CGO_ENABLED=0 go build -trimpath -o bin/timestamp-cli ./source/cmd/timestamp-cli + CGO_ENABLED=0 go build -trimpath -o bin/timestamp-server ./source/cmd/timestamp-server + go test ./source/... + # 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:v1 -f .tekton/tsa-unit-test.yaml'. From 8dac9c16e8f9164ef73bf0d4482fec9be9306fc4 Mon Sep 17 00:00:00 2001 From: JasonPowr <20076537@mail.wit.ie> Date: Thu, 19 Oct 2023 16:59:07 +0100 Subject: [PATCH 4/4] update task --- .tekton/timestamp-authority-pull-request.yaml | 2 +- .tekton/timestamp-authority-push.yaml | 2 +- .tekton/tsa-unit-test.yaml | 9 ++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.tekton/timestamp-authority-pull-request.yaml b/.tekton/timestamp-authority-pull-request.yaml index e046ff88..6b00da8b 100644 --- a/.tekton/timestamp-authority-pull-request.yaml +++ b/.tekton/timestamp-authority-pull-request.yaml @@ -379,7 +379,7 @@ spec: - name: name value: go-unit-test - name: bundle - value: quay.io/securesign/tsa-unit-test@sha256:6868c35f5840966bc510aed6ca42bf8dc02954d662a721d98b2dd5b04326c1f6 + value: quay.io/securesign/tsa-unit-test@sha256:9e6a48c07c34027656f25d0a0971ea38547135995a2151dfebf18210abfc773f - name: kind value: task resolver: bundles diff --git a/.tekton/timestamp-authority-push.yaml b/.tekton/timestamp-authority-push.yaml index 95257635..aada85da 100644 --- a/.tekton/timestamp-authority-push.yaml +++ b/.tekton/timestamp-authority-push.yaml @@ -376,7 +376,7 @@ spec: - name: name value: go-unit-test - name: bundle - value: quay.io/securesign/tsa-unit-test@sha256:6868c35f5840966bc510aed6ca42bf8dc02954d662a721d98b2dd5b04326c1f6 + value: quay.io/securesign/tsa-unit-test@sha256:9e6a48c07c34027656f25d0a0971ea38547135995a2151dfebf18210abfc773f - name: kind value: task resolver: bundles diff --git a/.tekton/tsa-unit-test.yaml b/.tekton/tsa-unit-test.yaml index 446f3efc..5c158902 100644 --- a/.tekton/tsa-unit-test.yaml +++ b/.tekton/tsa-unit-test.yaml @@ -10,13 +10,12 @@ spec: steps: - name: run-tests image: registry.access.redhat.com/ubi9/go-toolset@sha256:7e49e105a854749d67e5e02fb4069b48bd50445098c780b7f808cc351dee2589 - workingDir: $(workspaces.source.path) + workingDir: $(workspaces.source.path)/source script: | #!/usr/bin/env sh - git config --global --add safe.directory $(workspaces.source.path) - CGO_ENABLED=0 go build -trimpath -o bin/timestamp-cli ./source/cmd/timestamp-cli - CGO_ENABLED=0 go build -trimpath -o bin/timestamp-server ./source/cmd/timestamp-server - go test ./source/... + 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: