diff --git a/buildspec.yaml b/buildspec.yaml index 0c03513..afd5686 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 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