diff --git a/charts/openconcho/templates/tests/test-healthz.yaml b/charts/openconcho/templates/tests/test-healthz.yaml new file mode 100644 index 0000000..5247baa --- /dev/null +++ b/charts/openconcho/templates/tests/test-healthz.yaml @@ -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'" diff --git a/charts/openconcho/templates/tests/test-spa-root.yaml b/charts/openconcho/templates/tests/test-spa-root.yaml new file mode 100644 index 0000000..9acb229 --- /dev/null +++ b/charts/openconcho/templates/tests/test-spa-root.yaml @@ -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"