feat(helm): add test-healthz and test-spa-root helm test jobs
This commit is contained in:
24
charts/openconcho/templates/tests/test-healthz.yaml
Normal file
24
charts/openconcho/templates/tests/test-healthz.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: "{{ include "openconcho.fullname" . }}-test-healthz"
|
||||
labels:
|
||||
{{- include "openconcho.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
helm.sh/hook: test
|
||||
helm.sh/hook-delete-policy: before-hook-creation
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: healthz
|
||||
image: busybox
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
RESPONSE=$(wget -qO- http://{{ include "openconcho.fullname" . }}:{{ .Values.service.port }}/healthz)
|
||||
if [ "$RESPONSE" != "ok" ]; then
|
||||
echo "FAIL: expected 'ok', got '$RESPONSE'"
|
||||
exit 1
|
||||
fi
|
||||
echo "PASS: /healthz returned 'ok'"
|
||||
23
charts/openconcho/templates/tests/test-spa-root.yaml
Normal file
23
charts/openconcho/templates/tests/test-spa-root.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: "{{ include "openconcho.fullname" . }}-test-spa-root"
|
||||
labels:
|
||||
{{- include "openconcho.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
helm.sh/hook: test
|
||||
helm.sh/hook-delete-policy: before-hook-creation
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: spa-root
|
||||
image: busybox
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
if ! wget -qO /dev/null http://{{ include "openconcho.fullname" . }}:{{ .Values.service.port }}/; then
|
||||
echo "FAIL: GET / did not return HTTP 200"
|
||||
exit 1
|
||||
fi
|
||||
echo "PASS: / returned HTTP 200"
|
||||
Reference in New Issue
Block a user