Skip to content
Snippets Groups Projects
Commit 1d520f92 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-3328 use new helm unittest framework

parent 65d305b8
No related branches found
No related tags found
No related merge requests found
......@@ -4,4 +4,4 @@ set -e
helm template ./src/main/helm/ -f src/test/helm-linter-values.yaml
helm lint -f src/test/helm-linter-values.yaml ./src/main/helm/
cd src/main/helm && helm unittest --helm3 -f '../../test/helm/*.yaml' -v '../../test/unit-values.yaml' .
\ No newline at end of file
cd src/main/helm && helm unittest -f '../../test/helm/*.yaml' -v '../../test/unit-values.yaml' .
\ No newline at end of file
......@@ -34,14 +34,14 @@ tests:
- it: check default labels
asserts:
- equal:
path: metadata.labels.[app.kubernetes.io/instance]
path: metadata.labels["app.kubernetes.io/instance"]
value: afm-adapter
- equal:
path: metadata.labels.[app.kubernetes.io/name]
path: metadata.labels["app.kubernetes.io/name"]
value: intelliform-adapter
- equal:
path: metadata.labels.[app.kubernetes.io/part-of]
path: metadata.labels["app.kubernetes.io/part-of"]
value: ozgcloud
- equal:
path: metadata.labels.[app.kubernetes.io/namespace]
path: metadata.labels["app.kubernetes.io/namespace"]
value: sh-helm-test
......@@ -47,7 +47,7 @@ tests:
path: metadata.namespace
value: helm-test
- isNotEmpty:
path: data.[.dockerconfigjson]
path: data[".dockerconfigjson"]
- it: should not create image pull secret
set:
......
......@@ -52,8 +52,9 @@ tests:
value: intelliform-adapter
- it: should match service path
asserts:
- isEmpty:
- equal:
path: spec.rules[0].http.paths[0].path
value: ''
- it: should match service pathType
asserts:
- equal:
......@@ -106,7 +107,7 @@ tests:
- it: should use letsencrypt-prod cluster-issuer as default
asserts:
- equal:
path: metadata.annotations.[cert-manager.io/cluster-issuer]
path: metadata.annotations["cert-manager.io/cluster-issuer"]
value: letsencrypt-prod
- it: should use letsencrypt-staging cluster-issuer if use_staging_cert is true
......@@ -114,7 +115,7 @@ tests:
ingress.use_staging_cert: true
asserts:
- equal:
path: metadata.annotations.[cert-manager.io/cluster-issuer]
path: metadata.annotations["cert-manager.io/cluster-issuer"]
value: letsencrypt-staging
- it: should use letsencrypt-prod cluster-issuer if use_staging_cert is false
......@@ -122,10 +123,10 @@ tests:
ingress.use_staging_cert: false
asserts:
- equal:
path: metadata.annotations.[cert-manager.io/cluster-issuer]
path: metadata.annotations["cert-manager.io/cluster-issuer"]
value: letsencrypt-prod
- it: should set proxy body size to 42m
asserts:
- equal:
path: metadata.annotations.[nginx.ingress.kubernetes.io/proxy-body-size]
path: metadata.annotations["nginx.ingress.kubernetes.io/proxy-body-size"]
value: 42m
\ No newline at end of file
......@@ -34,7 +34,7 @@ tests:
- isKind:
of: ServiceMonitor
- equal:
path: metadata.labels.[component]
path: metadata.labels["component"]
value: afm-adapter-service-monitor
- it: should have the metrics endpoint configured by default
set:
......@@ -64,13 +64,13 @@ tests:
- it: selector should contain the component label with the value afm-adapter-service
asserts:
- equal:
path: spec.selector.matchLabels.[component]
path: spec.selector.matchLabels["component"]
value: afm-adapter-service
- it: selector should contain helm recommended labels name and namespace
asserts:
- equal:
path: spec.selector.matchLabels.[app.kubernetes.io/name]
path: spec.selector.matchLabels["app.kubernetes.io/name"]
value: afm-adapter
- equal:
path: spec.selector.matchLabels.[app.kubernetes.io/namespace]
path: spec.selector.matchLabels["app.kubernetes.io/namespace"]
value: sh-helm-test
......@@ -34,7 +34,7 @@ tests:
- isKind:
of: Service
- equal:
path: metadata.labels.[component]
path: metadata.labels["component"]
value: afm-adapter-service
- it: should be of type ClusterIP
asserts:
......@@ -65,14 +65,14 @@ tests:
- it: selector should contain the component label with the value afm-adapter
asserts:
- equal:
path: spec.selector.[component]
path: spec.selector["component"]
value: afm-adapter
- it: selector should contain helm recommended labels name and namespace
asserts:
- equal:
path: spec.selector.[app.kubernetes.io/name]
path: spec.selector["app.kubernetes.io/name"]
value: afm-adapter
- equal:
path: spec.selector.[app.kubernetes.io/namespace]
path: spec.selector["app.kubernetes.io/namespace"]
value: sh-helm-test
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment