Skip to content

Commit

Permalink
build(HMS-4895): add unit-test execution
Browse files Browse the repository at this point in the history
Add the unit tests execution for the tekton pipeline.

https://issues.redhat.com/browse/HMS-4895

Signed-off-by: Alejandro Visiedo <[email protected]>
  • Loading branch information
avisiedo committed Dec 11, 2024
1 parent 6a90038 commit 3ebeaa0
Showing 1 changed file with 50 additions and 1 deletion.
51 changes: 50 additions & 1 deletion .tekton/idmsvc-backend-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,55 @@ spec:
workspace: git-auth
- name: netrc
workspace: netrc
- name: run-unit-tests
description: Execute the unit tests for idmsvc-backend
params:
- name: SOURCE_ARTIFACT
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
runAfter:
- prefetch-dependencies
workspaces:
- name: git-basic-auth
workspace: git-auth
- name: source
workspace: workspace
taskSpec:
params:
- description: The Trusted Artifact URI pointing to the artifact with the application source code.
name: SOURCE_ARTIFACT
type: string
volumes:
# New volume to store a copy of the source code accessible only to this Task.
- name: workdir
emptyDir: {}
stepTemplates:
volumeMounts:
- name: workdir
mountPath: /var/workdir
readOnly: false
steps:
- name: use-trusted-artifact
image: quay.io/redhat-appstudio/build-trusted-artifacts:latest@sha256:81c4864dae6bb11595f657be887e205262e70086a05ed16ada827fd6391926ac
args:
- use
- $(params.SOURCE_ARTIFACT)=/var/workdir
- name: unit-tests
image: registry.access.redhat.com/ubi9/go-toolset:1.21.11-9.1726696856@sha256:2fead14be2734020f98c731fef30cc54e99fe889a53cac97e80f6f043778b567
workingDir: /var/workdir
computeResources:
requests:
memory: 7Gi
cpu: 1000m
limits:
memory: 14Gi
cpu: 2000m
# securityContext:
# runAsUser: 0
scripts: |
#!/bin/bash
set -ex
make test-unit
- name: build-images
matrix:
params:
Expand Down Expand Up @@ -263,7 +312,7 @@ spec:
- name: IMAGE_APPEND_PLATFORM
value: "true"
runAfter:
- prefetch-dependencies
- run-unit-tests
taskRef:
params:
- name: name
Expand Down

0 comments on commit 3ebeaa0

Please sign in to comment.