Skip to content

Commit

Permalink
Add chart tests (#442)
Browse files Browse the repository at this point in the history
* Add chart tests

* Use frontend image for the tests

* Change YAML syntax

* Set test image in values.yaml

* bump chart to 0.2.0
  • Loading branch information
andresmgot authored Aug 16, 2018
1 parent 047ab65 commit 16cb329
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 1 deletion.
2 changes: 1 addition & 1 deletion chart/kubeapps/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: kubeapps
version: 0.1.2
version: 0.2.0
appVersion: 1.0.0.alpha.5
description: Kubeapps is a dashboard for your Kubernetes cluster that makes it easy to deploy and manage applications in your cluster using Helm
icon: https://raw.githubusercontent.com/kubeapps/kubeapps/master/docs/img/logo.png
Expand Down
20 changes: 20 additions & 0 deletions chart/kubeapps/templates/tests/test-chartsvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ .Release.Name }}-chartsvc-test"
annotations:
"helm.sh/hook": test-success
spec:
containers:
- name: {{ .Release.Name }}-chartsvc-test
image: {{ .Values.testImage.repository }}:{{ .Values.testImage.tag }}
env:
- name: CHARTSVC_HOST
value: {{ template "kubeapps.chartsvc.fullname" . }}.{{ .Release.Namespace }}
- name: CHARTSVC_PORT
value: "{{ .Values.chartsvc.service.port }}"
command:
- sh
- -c
- curl $CHARTSVC_HOST:$CHARTSVC_PORT/v1/charts | grep wordpress
restartPolicy: Never
18 changes: 18 additions & 0 deletions chart/kubeapps/templates/tests/test-dashboard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ .Release.Name }}-dashboard-test"
annotations:
"helm.sh/hook": test-success
spec:
containers:
- name: {{ .Release.Name }}-dashboard-test
image: {{ .Values.testImage.repository }}:{{ .Values.testImage.tag }}
env:
- name: DASHBOARD_HOST
value: {{ template "kubeapps.fullname" . }}.{{ .Release.Namespace }}
command:
- sh
- -c
- curl $DASHBOARD_HOST | grep 'You need to enable JavaScript to run this app'
restartPolicy: Never
22 changes: 22 additions & 0 deletions chart/kubeapps/templates/tests/test-tiller-proxy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ .Release.Name }}-tiller-proxy-test"
annotations:
"helm.sh/hook": test-success
spec:
containers:
- name: {{ .Release.Name }}-tiller-proxy-test
image: {{ .Values.testImage.repository }}:{{ .Values.testImage.tag }}
env:
- name: TILLER_PROXY_HOST
value: {{ template "kubeapps.tiller-proxy.fullname" . }}.{{ .Release.Namespace }}
- name: TILLER_PROXY_PORT
value: "{{ .Values.tillerProxy.service.port }}"
- name: KUBEAPPS_RELEASE
value: {{ .Release.Name }}
command:
- sh
- -c
- "curl -ik -H \"Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)\" $TILLER_PROXY_HOST:$TILLER_PROXY_PORT/v1/releases | grep $KUBEAPPS_RELEASE"
restartPolicy: Never
7 changes: 7 additions & 0 deletions chart/kubeapps/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,10 @@ affinity: {}
rbac:
# Perform creation of RBAC resources
create: true

testImage:
# Image used for the tests. The only requirement is to include curl
registry: docker.io
repository: bitnami/nginx
tag: 1.14.0-r27

0 comments on commit 16cb329

Please sign in to comment.