Skip to content

Commit

Permalink
test: should be removed
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonPowr committed Nov 25, 2024
1 parent 0d6054c commit 9413606
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .tekton/docker-build-oci-ta-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
- name: url
value: 'https://github.com/securesign/pipelines.git'
- name: revision
value: 'main'
value: 'test-standalone-pipelines' # should be removed, only for testing purposes
- name: pathInRepo
value: 'pipelines/docker-build-oci-ta.yaml'
taskRunTemplate: {}
Expand Down
2 changes: 1 addition & 1 deletion .tekton/docker-build-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
- name: url
value: 'https://github.com/securesign/pipelines.git'
- name: revision
value: 'main'
value: 'test-standalone-pipelines' # should be removed, only for testing purposes
- name: pathInRepo
value: 'pipelines/docker-build.yaml'
taskRunTemplate: {}
Expand Down
4 changes: 2 additions & 2 deletions pipelines/docker-build-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,9 @@ spec:
- name: url
value: 'https://github.com/securesign/pipelines.git'
- name: revision
value: '655f32df7857dbdc02f542b0c5ec07cbb52e3119'
value: 'test-standalone-pipelines' # should be removed, only for testing purposes
- name: pathInRepo
value: 'tasks/go-unit-test-oci-ta.yaml'
value: 'tasks/go-unit-test.yaml'
params:
- name: SOURCE_ARTIFACT
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
Expand Down
2 changes: 1 addition & 1 deletion pipelines/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ spec:
- name: url
value: 'https://github.com/securesign/pipelines.git'
- name: revision
value: '655f32df7857dbdc02f542b0c5ec07cbb52e3119'
value: 'test-standalone-pipelines' # should be removed, only for testing purposes
- name: pathInRepo
value: 'tasks/go-unit-test.yaml'
params:
Expand Down
55 changes: 0 additions & 55 deletions tasks/go-unit-test-oci-ta.yaml

This file was deleted.

26 changes: 26 additions & 0 deletions tasks/go-unit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ metadata:
tekton.dev/title: "Go Unit Test Task"
spec:
params:
- description: The trusted artifact URI containing the application source code.
name: SOURCE_ARTIFACT
type: string
default: ""
- description: The Trusted Artifact URI pointing to the artifact with the prefetched dependencies.
name: CACHI2_ARTIFACT
type: string
default: ""
- description: The go command used to run the go unit test
name: GO_TEST_COMMAND
type: string
Expand All @@ -18,17 +26,35 @@ spec:
volumeMounts:
- mountPath: /var/workdir
name: workdir
# This path is hard coded in the cachi2.env file.
- mountPath: /cachi2
name: cachi2
securityContext:
# This is needed because the different steps in this Task run with different user IDs.
runAsUser: 0
steps:
- image: quay.io/redhat-appstudio/build-trusted-artifacts:latest@sha256:4e39fb97f4444c2946944482df47b39c5bbc195c54c6560b0647635f553ab23d
name: use-trusted-artifact
args:
- use
- $(params.SOURCE_ARTIFACT)=/var/workdir/source
- $(params.CACHI2_ARTIFACT)=/cachi2
when:
- input: "$(params.SOURCE_ARTIFACT)$(params.CACHI2_ARTIFACT)"
operator: notin
values: ['']
- name: run-tests
image: $(params.GO_BASE_IMAGE)
workingDir: /var/workdir/source
script: |
#!/usr/bin/env sh
if [ -f "/cachi2/cachi2.env" ]; then
source "/cachi2/cachi2.env"
fi
go mod vendor
$(params.GO_TEST_COMMAND)
volumes:
- name: workdir
emptyDir: {}
- name: cachi2
emptyDir: {}

0 comments on commit 9413606

Please sign in to comment.