Skip to content
Snippets Groups Projects
Commit 81fc4810 authored by Sören Henning's avatar Sören Henning
Browse files

Merge branch 'add-helm-test' into 'master'

Add Helm test

Closes #202

See merge request !285
parents 5cfa8712 910394f7
No related branches found
No related tags found
1 merge request!285Add Helm test
Pipeline #8683 passed
...@@ -161,10 +161,10 @@ test-helm: ...@@ -161,10 +161,10 @@ test-helm:
- cd helm - cd helm
- helm dependencies update . - helm dependencies update .
- helm install theodolite . -f preconfigs/minimal.yaml --wait - helm install theodolite . -f preconfigs/minimal.yaml --wait
- helm test theodolite
- kubectl get nodes -o wide - kubectl get nodes -o wide
- kubectl get pods --all-namespaces -o wide - kubectl get pods --all-namespaces -o wide
- kubectl get services --all-namespaces -o wide - kubectl get services --all-namespaces -o wide
- helm test theodolite
after_script: after_script:
- k3d cluster delete $CLUSTERNAME - k3d cluster delete $CLUSTERNAME
......
../theodolite-benchmarks/definitions/
\ No newline at end of file
../../theodolite/examples/operator/
\ No newline at end of file
apiVersion: theodolite.com/v1
kind: execution
metadata:
name: theodolite-test-execution
spec:
benchmark: "example-benchmark"
loads:
loadType: "NumSensors"
loadValues: [100]
resources:
resourceType: "Instances"
resourceValues: [1]
slos:
- name: "lag trend"
properties:
warmup: 0 # in seconds
execution:
strategy:
name: "RestrictionSearch"
restrictions:
- "LowerBound"
searchStrategy: "LinearSearch"
duration: 60 # in seconds
repetitions: 1
loadGenerationDelay: 0 # in seconds
configOverrides: []
../../theodolite-benchmarks/definitions/
\ No newline at end of file
...@@ -7,7 +7,7 @@ metadata: ...@@ -7,7 +7,7 @@ metadata:
{{- include "theodolite.labels" . | nindent 4 }} {{- include "theodolite.labels" . | nindent 4 }}
annotations: annotations:
"helm.sh/hook": test "helm.sh/hook": test
"helm.sh/hook-delete-policy": hook-succeeded "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
spec: spec:
containers: containers:
- name: wget - name: wget
......
{{- if .Values.operator.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: "{{ include "theodolite.fullname" . }}-test-example-files"
annotations:
"helm.sh/hook": test
"helm.sh/hook-weight": "1"
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
data:
{{ ($.Files.Glob "benchmark-definitions/examples/*").AsConfig | indent 2 }}
{{ ($.Files.Glob "benchmark-definitions/test/*").AsConfig | indent 2 }}
---
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "theodolite.fullname" . }}-test-example"
labels:
{{- include "theodolite.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
"helm.sh/hook-weight": "2"
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
spec:
restartPolicy: Never
containers:
- name: kubectl
image: bitnami/kubectl
command:
- bash
- -c
- |
cd /example-resources/
kubectl apply -f example-configmap.yaml
kubectl apply -f example-benchmark.yaml
kubectl apply -f test-example-execution.yaml
timeout 180s bash -c "until kubectl get exec theodolite-test-execution -o json | jq -r .status.executionState | grep -i '^Finished$'; do kubectl get exec theodolite-test-execution -o json | jq -r .status.executionState; sleep 5s; done"
RETURN=$?
echo "RETURN: $RETURN"
kubectl delete -f example-configmap.yaml
kubectl delete -f example-benchmark.yaml
kubectl delete -f test-example-execution.yaml
exit $RETURN
volumeMounts:
- name: example-resources
mountPath: /example-resources
volumes:
- name: example-resources
configMap:
name: "{{ include "theodolite.fullname" . }}-test-example-files"
serviceAccountName: {{ include "theodolite.serviceAccountName" . }}
{{- end }}
...@@ -6,7 +6,7 @@ kind: ConfigMap ...@@ -6,7 +6,7 @@ kind: ConfigMap
metadata: metadata:
name: benchmark-resources-{{ $name }} name: benchmark-resources-{{ $name }}
data: data:
{{ ($.Files.Glob (printf "benchmark-definitions/%s/resources/*" $name)).AsConfig | indent 2 }} {{ ($.Files.Glob (printf "benchmark-definitions/theodolite-benchmarks/%s/resources/*" $name)).AsConfig | indent 2 }}
--- ---
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- range $benchmark, $enabled := .Values.operator.theodoliteBenchmarks.benchmarks }} {{- range $benchmark, $enabled := .Values.operator.theodoliteBenchmarks.benchmarks }}
{{- if $enabled -}} {{- if $enabled -}}
{{- $name := kebabcase $benchmark }} {{- $name := kebabcase $benchmark }}
{{ $.Files.Get (printf "benchmark-definitions/%s/%s-benchmark-operator.yaml" $name $name) }} {{ $.Files.Get (printf "benchmark-definitions/theodolite-benchmarks/%s/%s-benchmark-operator.yaml" $name $name) }}
--- ---
{{- end }} {{- end }}
{{- end }} {{- end }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment