Skip to content
Snippets Groups Projects
Commit 6fab29fc authored by OZG-Cloud Team's avatar OZG-Cloud Team
Browse files

OZG-3328 use new helm unittest framework

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