From 92c4b5e21209caaeb288adad076e59acefaf411a Mon Sep 17 00:00:00 2001 From: Lianhao Lu Date: Tue, 16 Jul 2024 17:28:24 +0800 Subject: [PATCH] helm test: Make curl fail if http_status > 400 returned Signed-off-by: Lianhao Lu --- helm-charts/common/asr/templates/tests/test-pod.yaml | 2 +- helm-charts/common/web-retriever/templates/tests/test-pod.yaml | 2 +- helm-charts/common/whisper/templates/tests/test-pod.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/helm-charts/common/asr/templates/tests/test-pod.yaml b/helm-charts/common/asr/templates/tests/test-pod.yaml index 985042a79..ab05bc1ef 100644 --- a/helm-charts/common/asr/templates/tests/test-pod.yaml +++ b/helm-charts/common/asr/templates/tests/test-pod.yaml @@ -18,7 +18,7 @@ spec: command: ['sh', '-c'] args: - | - curl http://{{ include "asr.fullname" . }}:{{ .Values.service.port }}/v1/audio/transcriptions \ + curl -sS --fail-with-body http://{{ include "asr.fullname" . }}:{{ .Values.service.port }}/v1/audio/transcriptions \ -XPOST \ -d '{"byte_str": "UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"}' \ -H 'Content-Type: application/json' diff --git a/helm-charts/common/web-retriever/templates/tests/test-pod.yaml b/helm-charts/common/web-retriever/templates/tests/test-pod.yaml index 758204b1a..c4e6a5f52 100644 --- a/helm-charts/common/web-retriever/templates/tests/test-pod.yaml +++ b/helm-charts/common/web-retriever/templates/tests/test-pod.yaml @@ -19,7 +19,7 @@ spec: args: - | your_embedding=$(python -c "import random; embedding = [random.uniform(-1, 1) for _ in range(768)]; print(embedding)"); - curl http://{{ include "web-retriever.fullname" . }}:{{ .Values.service.port }}/v1/web_retrieval \ + curl -sS --fail-with-body http://{{ include "web-retriever.fullname" . }}:{{ .Values.service.port }}/v1/web_retrieval \ -X POST \ -d "{\"text\":\"What is OPEA?\",\"embedding\":${your_embedding}}" \ -H 'Content-Type: application/json' diff --git a/helm-charts/common/whisper/templates/tests/test-pod.yaml b/helm-charts/common/whisper/templates/tests/test-pod.yaml index 120f6333e..acb45ea33 100644 --- a/helm-charts/common/whisper/templates/tests/test-pod.yaml +++ b/helm-charts/common/whisper/templates/tests/test-pod.yaml @@ -18,7 +18,7 @@ spec: command: ['sh', '-c'] args: - | - curl http://{{ include "whisper.fullname" . }}:{{ .Values.service.port }}/v1/asr \ + curl -sS --fail-with-body http://{{ include "whisper.fullname" . }}:{{ .Values.service.port }}/v1/asr \ -X POST \ -d '{"audio": "UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"}' \ -H 'Content-Type: application/json'