Skip to content

Commit

Permalink
chore(caraml): add tests for turing
Browse files Browse the repository at this point in the history
  • Loading branch information
mbruner committed Dec 12, 2023
1 parent 78afdc3 commit 6ea7d98
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 10 deletions.
2 changes: 0 additions & 2 deletions charts/caraml-authz/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ Common labels
{{- define "caraml-authz.labels" -}}
app.kubernetes.io/name: {{ template "caraml-authz.name" . }}
helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | quote}}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ template "caraml-authz.version" . }}
{{- end }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: caraml
Expand Down
2 changes: 0 additions & 2 deletions charts/mlp/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ Common labels
{{- define "mlp.labels" -}}
app.kubernetes.io/name: {{ template "mlp.name" . }}
helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | quote}}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ template "mlp.version" . }}
{{- end }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: caraml
Expand Down
26 changes: 25 additions & 1 deletion charts/turing/tests/turing_deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ tests:
- equal: # check database secret key
path: spec.template.spec.containers[0].env[0].valueFrom.secretKeyRef.key
value: secret-key

- it: should set releasedVersion as deployment image tag if deployment image tag is unset
set:
deployment:
Expand All @@ -91,6 +92,29 @@ tests:
- matchRegex:
path: metadata.name
pattern: my-release-turing$
- equal: # check database secret name
- equal: # check image version
path: spec.template.spec.containers[0].image
value: ghcr.io/caraml-dev/turing:1.11.0-test-released-version
- equal: # check version label
path: spec.template.metadata.labels.version
value: 1.11.0-test-released-version

- it: image tag must have precedence over releasedVersion
set:
deployment:
image:
tag: 1.11.0-test-image-tag
rendered:
releasedVersion: 1.11.0-test-released-version
asserts:
- isKind:
of: Deployment
- matchRegex:
path: metadata.name
pattern: my-release-turing$
- equal: # check image version
path: spec.template.spec.containers[0].image
value: ghcr.io/caraml-dev/turing:1.11.0-test-image-tag
- equal: # check version label
path: spec.template.metadata.labels.version
value: 1.11.0-test-image-tag
4 changes: 1 addition & 3 deletions charts/xp-management/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ version: {{ template "management-svc.version" . }}
release: {{ .Release.Name }}
app.kubernetes.io/name: {{ template "management-svc.name" . }}
helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | quote}}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/version: {{ template "management-svc.version" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: caraml
Expand Down
2 changes: 0 additions & 2 deletions charts/xp-treatment/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ version: {{ template "treatment-svc.version" . }}
release: {{ .Release.Name }}
app.kubernetes.io/name: {{ template "treatment-svc.name" . }}
helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | quote}}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ template "treatment-svc.version" . }}
{{- end }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: caraml
Expand Down

0 comments on commit 6ea7d98

Please sign in to comment.