Skip to content
Snippets Groups Projects
Commit 56e3ce1b authored by OZGCloud's avatar OZGCloud
Browse files

OZG-3328 cleanup helm unittests and add tests to cover each line

parent f99c5f45
Branches
Tags
No related merge requests found
......@@ -22,26 +22,48 @@
# unter der Lizenz sind dem Lizenztext zu entnehmen.
#
suite: test deployment
suite: test service monitor
release:
name: afm-adapter
namespace: sh-helm-test
templates:
- templates/service_monitor.yaml
tests:
- it: should have the label component with value afm-adapter-service-monitor attached
- it: should have basic info and the label component with value afm-adapter-service-monitor attached
asserts:
- isKind:
of: ServiceMonitor
- isAPIVersion:
of: monitoring.coreos.com/v1
- equal:
path: metadata.name
value: afm-adapter
- equal:
path: metadata.namespace
value: sh-helm-test
- equal:
path: metadata.labels["component"]
value: afm-adapter-service-monitor
- it: should contain default lables and component lables
asserts:
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: afm-adapter
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: afm-adapter
app.kubernetes.io/namespace: sh-helm-test
app.kubernetes.io/part-of: ozgcloud
app.kubernetes.io/version: 0.0.0-MANAGED-BY-JENKINS
component: afm-adapter-service-monitor
helm.sh/chart: Intelliform-Adapter-0.0.0-MANAGED-BY-JENKINS
ozg-component: eingangsadapter
- it: should have the metrics endpoint configured by default
set:
env.springProfiles: oc,stage
asserts:
- isKind:
of: ServiceMonitor
- contains:
path: spec.endpoints
content:
......@@ -49,8 +71,6 @@ tests:
path: /actuator/prometheus
- it: should be able to enable the endpoint
asserts:
- isKind:
of: ServiceMonitor
- contains:
path: spec.endpoints
content:
......
......@@ -22,20 +22,28 @@
# unter der Lizenz sind dem Lizenztext zu entnehmen.
#
suite: test deployment
suite: test service
release:
name: afm-adapter
namespace: sh-helm-test
templates:
- templates/service.yaml
tests:
- it: should have the label component with value afm-adapter-service attached
- it: should have basics and the label component with value afm-adapter-service attached
asserts:
- isKind:
of: Service
- isAPIVersion:
of: v1
- equal:
path: metadata.labels["component"]
value: afm-adapter-service
- equal:
path: metadata.name
value: afm-adapter
- equal:
path: metadata.namespace
value: sh-helm-test
- it: should be of type ClusterIP
asserts:
- equal:
......@@ -76,3 +84,17 @@ tests:
path: spec.selector["app.kubernetes.io/namespace"]
value: sh-helm-test
- it: should contain default lables and component lables
asserts:
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: afm-adapter
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: afm-adapter
app.kubernetes.io/namespace: sh-helm-test
app.kubernetes.io/part-of: ozgcloud
app.kubernetes.io/version: 0.0.0-MANAGED-BY-JENKINS
component: afm-adapter-service
helm.sh/chart: Intelliform-Adapter-0.0.0-MANAGED-BY-JENKINS
ozg-component: eingangsadapter
\ 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