-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from innovatrics/feature/helm-tests
Helm tests
- Loading branch information
Showing
11 changed files
with
356 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,8 @@ jobs: | |
# this is needed only temporarily - see https://github.com/helm/helm/issues/12423 | ||
version: 3.12.3 | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Install kubectl | ||
uses: azure/setup-kubectl@v3 | ||
- name: Build helm dependencies | ||
run: | | ||
helm dependency build . | ||
|
@@ -30,3 +32,38 @@ jobs: | |
- uses: actions/setup-python@v3 | ||
- uses: gabe565/setup-helm-docs-action@v1 | ||
- uses: pre-commit/[email protected] | ||
- name: Create kind cluster | ||
uses: helm/[email protected] | ||
- name: Install chart prerequisites | ||
env: | ||
REGISTRY_PASS: ${{ secrets.REGISTRY_PASS }} | ||
LICENSE_BASE64: ${{ secrets.LICENSE_BASE64 }} | ||
run: | | ||
kubectl create secret docker-registry --dry-run=client sf-gitlab-registry-creds \ | ||
--docker-server=registry.gitlab.com \ | ||
--docker-username=sf-distribution \ | ||
--docker-password=${REGISTRY_PASS} -o yaml > docker-secret.yaml | ||
echo ${LICENSE_BASE64} | base64 -d > iengine.lic | ||
kubectl create secret generic --dry-run=client iface-lic \ | ||
--from-file=iengine.lic -o yaml > lic-secret.yaml | ||
kubectl apply -f docker-secret.yaml | ||
kubectl apply -f lic-secret.yaml | ||
- name: Install helm chart | ||
run: | | ||
helm install -f ci-values.yaml smartface . | ||
kubectl rollout status deployment sf-api --timeout=300s | ||
kubectl wait --for=condition=complete job/sf-wl-update-log-population --timeout=300s | ||
- name: Test helm chart | ||
run: | | ||
helm test smartface | ||
- name: Dump cluster info | ||
if: ${{ always() }} | ||
run: | | ||
kubectl cluster-info dump > cluster-info.txt | ||
- name: Upload cluster-info | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: cluster-info | ||
path: | | ||
cluster-info.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# we don't need persistence since the kind cluster will be deleted after the tests anyway | ||
rabbitmq: | ||
persistence: | ||
enabled: false | ||
postgresql: | ||
primary: | ||
persistence: | ||
enabled: false | ||
minio: | ||
persistence: | ||
enabled: false | ||
|
||
# We enabled edge streams so we can run all of the tests in one go with all features enabled | ||
features: | ||
edgeStreams: | ||
enabled: true | ||
|
||
api: | ||
resources: null | ||
authApi: | ||
resources: null | ||
graphqlApi: | ||
resources: null | ||
detector: | ||
resources: null | ||
extractor: | ||
resources: null | ||
matcher: | ||
resources: null | ||
liveness: | ||
resources: null | ||
edgeStreamProcessor: | ||
resources: null | ||
# edge stream tests test WL sync, which requires the population job to be run | ||
edgeStreamsStateSync: | ||
resources: null | ||
wlStreamPopulationJob: | ||
enabled: true | ||
base: | ||
resources: null | ||
faceMatcher: | ||
resources: null | ||
accessController: | ||
resources: null | ||
streamDataDbWorker: | ||
resources: null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{{- if (and .Values.features.edgeStreams.enabled .Values.api.enabled .Values.graphqlApi.enabled (not .Values.graphqlApi.enableAuth) (eq .Values.edgeStreamProcessor.operationMode.matchingDataStrategy "ServerOnly")) }} | ||
{{- $name := include "smartface.edgeStreamTests.name" . -}} | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: {{ $name | quote }} | ||
annotations: | ||
"helm.sh/hook": test | ||
{{- with .Values.podAnnotations }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.tests.podAnnotations }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
labels: | ||
{{- with .Values.podLabels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.tests.podLabels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
serviceAccountName: {{ .Values.serviceAccount.name | quote }} | ||
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
containers: | ||
- name: {{ $name | quote }} | ||
image: {{ include "smartface.image" (dict "local" .Values.tests.image "global" .Values.global.image "defaultVersion" .Chart.AppVersion) }} | ||
imagePullPolicy: {{ .Values.tests.image.pullPolicy }} | ||
args: ['--filter', 'Category=EdgeStreams'] | ||
env: | ||
- name: "SF_TEST_API_URL" | ||
value: "http://{{ include "smartface.api.name" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.api.servicePort }}" | ||
- name: "SF_TEST_GQL_API_URL" | ||
value: "http://{{ include "smartface.graphqlApi.name" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.graphqlApi.servicePort }}" | ||
- name: "SF_ZMQ_HOST" | ||
value: "{{ include "smartface.base.name" . }}.{{ .Release.Namespace }}.svc.cluster.local" | ||
- name: "SF_ZMQ_PORT" | ||
value: "{{ .Values.base.zmqServicePort }}" | ||
|
||
{{- include "smartface.mqttConfig" . | nindent 4 }} | ||
- name: "SF_MQTT_HOST" | ||
value: "$(MQTT__Hostname)" | ||
- name: "SF_MQTT_PORT" | ||
value: "$(MQTT__Port)" | ||
- name: "SF_MQTT_USER" | ||
value: "$(MQTT__Username)" | ||
- name: "SF_MQTT_PASS" | ||
value: "$(MQTT__Password)" | ||
volumeMounts: | ||
{{- include "smartface.licVolumeMount" . | nindent 4 }} | ||
volumes: | ||
{{- include "smartface.licVolume" . | nindent 4 }} | ||
{{- with .Values.tests.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.tests.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
restartPolicy: Never | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{{- if (and .Values.api.enabled .Values.graphqlApi.enabled (not .Values.graphqlApi.enableAuth)) }} | ||
{{- $name := include "smartface.graphQlTests.name" . -}} | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: {{ $name | quote }} | ||
annotations: | ||
"helm.sh/hook": test | ||
{{- with .Values.podAnnotations }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.tests.podAnnotations }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
labels: | ||
{{- with .Values.podLabels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.tests.podLabels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
serviceAccountName: {{ .Values.serviceAccount.name | quote }} | ||
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
containers: | ||
- name: {{ $name | quote }} | ||
image: {{ include "smartface.image" (dict "local" .Values.tests.image "global" .Values.global.image "defaultVersion" .Chart.AppVersion) }} | ||
imagePullPolicy: {{ .Values.tests.image.pullPolicy }} | ||
args: ['--filter', 'Category=GraphQL'] | ||
env: | ||
- name: "SF_TEST_API_URL" | ||
value: "http://{{ include "smartface.api.name" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.api.servicePort }}" | ||
- name: "SF_TEST_GQL_API_URL" | ||
value: "http://{{ include "smartface.graphqlApi.name" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.graphqlApi.servicePort }}" | ||
volumeMounts: | ||
{{- include "smartface.licVolumeMount" . | nindent 4 }} | ||
volumes: | ||
{{- include "smartface.licVolume" . | nindent 4 }} | ||
{{- with .Values.tests.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.tests.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
restartPolicy: Never | ||
{{- end }} |
Oops, something went wrong.