From 6db7ea86f33113ea0d2b145ec8e531dc98c0ac72 Mon Sep 17 00:00:00 2001 From: Ales Dumikau Date: Fri, 14 Apr 2023 15:33:22 +0300 Subject: [PATCH 1/2] Add helm tests to mainnet --- helm/templates/tests/test-backend.yaml | 20 ++++++++++++++++++++ helm/templates/tests/test-frontend.yaml | 20 ++++++++++++++++++++ helm/templates/tests/test-mongo.yaml | 20 ++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 helm/templates/tests/test-backend.yaml create mode 100644 helm/templates/tests/test-frontend.yaml create mode 100644 helm/templates/tests/test-mongo.yaml diff --git a/helm/templates/tests/test-backend.yaml b/helm/templates/tests/test-backend.yaml new file mode 100644 index 0000000..0075626 --- /dev/null +++ b/helm/templates/tests/test-backend.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ .Release.Name }}-test-backend" + annotations: + "helm.sh/hook": test +spec: + containers: + - name: test-backend + image: curlimages/curl + command: ['curl'] + args: + - --fail + - --write-out + - '%{http_code}' + - --silent + - --output + - /dev/null + - 'http://{{ include "CID.fullname" . }}-backend-service:3000/api/version' + restartPolicy: Never diff --git a/helm/templates/tests/test-frontend.yaml b/helm/templates/tests/test-frontend.yaml new file mode 100644 index 0000000..3624bcd --- /dev/null +++ b/helm/templates/tests/test-frontend.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ .Release.Name }}-test-frontend" + annotations: + "helm.sh/hook": test +spec: + containers: + - name: test-frontend + image: curlimages/curl + command: ['curl'] + args: + - --fail + - --write-out + - '%{http_code}' + - --silent + - --output + - /dev/null + - 'http://{{ include "CID.fullname" . }}-frontend-service:80/' + restartPolicy: Never diff --git a/helm/templates/tests/test-mongo.yaml b/helm/templates/tests/test-mongo.yaml new file mode 100644 index 0000000..af98b91 --- /dev/null +++ b/helm/templates/tests/test-mongo.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ .Release.Name }}-test-mongo" + annotations: + "helm.sh/hook": test +spec: + containers: + - name: test-mongo + image: curlimages/curl + command: ['curl'] + args: + - --fail + - --write-out + - '%{http_code}' + - --silent + - --output + - /dev/null + - 'http://{{ include "CID.fullname" . }}-backend-service:3000/api/deals/stats' + restartPolicy: Never From 776b7583a340e108c4fe48370059f7c85edadf3f Mon Sep 17 00:00:00 2001 From: Ales Dumikau Date: Fri, 14 Apr 2023 15:38:43 +0300 Subject: [PATCH 2/2] Integrate helm tests into buildspec --- buildspec.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/buildspec.yaml b/buildspec.yaml index 13a802c..0766ce5 100644 --- a/buildspec.yaml +++ b/buildspec.yaml @@ -52,3 +52,4 @@ phases: - helm lint - helm template cid-checker-$NETWORK . -f env-values/$NETWORK.yaml - helm upgrade --install cid-checker-$NETWORK . -f env-values/$NETWORK.yaml + - helm test cid-checker-$NETWORK