Merge pull request #94 from bmbeverst/fix_tests

Fix new helm-unittest tests
This commit is contained in:
WrightNed 2024-02-22 14:24:37 +02:00 committed by GitHub
commit c255621cd6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 17 additions and 12 deletions

View File

@ -21,7 +21,7 @@ tests:
of: ConfigMap of: ConfigMap
- equal: - equal:
path: metadata.name path: metadata.name
value: RELEASE-NAME-ingress-nginx-custom-add-headers value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-custom-add-headers
- equal: - equal:
path: data.X-Another-Custom-Header path: data.X-Another-Custom-Header
value: Value value: Value

View File

@ -21,7 +21,7 @@ tests:
of: ConfigMap of: ConfigMap
- equal: - equal:
path: metadata.name path: metadata.name
value: RELEASE-NAME-ingress-nginx-custom-proxy-headers value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-custom-proxy-headers
- equal: - equal:
path: data.X-Custom-Header path: data.X-Custom-Header
value: Value value: Value

View File

@ -11,4 +11,4 @@ tests:
of: ConfigMap of: ConfigMap
- equal: - equal:
path: metadata.name path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-controller

View File

@ -6,6 +6,7 @@ tests:
- it: should create a DaemonSet if `controller.kind` is "DaemonSet" - it: should create a DaemonSet if `controller.kind` is "DaemonSet"
set: set:
controller.kind: DaemonSet controller.kind: DaemonSet
kind: Vanilla
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 1 count: 1
@ -13,4 +14,4 @@ tests:
of: DaemonSet of: DaemonSet
- equal: - equal:
path: metadata.name path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-controller

View File

@ -4,6 +4,8 @@ templates:
tests: tests:
- it: should create a Deployment - it: should create a Deployment
set:
kind: Vanilla
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 1 count: 1
@ -11,11 +13,12 @@ tests:
of: Deployment of: Deployment
- equal: - equal:
path: metadata.name path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-controller
- it: should create a Deployment with 3 replicas if `controller.replicaCount` is 3 - it: should create a Deployment with 3 replicas if `controller.replicaCount` is 3
set: set:
controller.replicaCount: 3 controller.replicaCount: 3
kind: Vanilla
asserts: asserts:
- equal: - equal:
path: spec.replicas path: spec.replicas
@ -25,6 +28,7 @@ tests:
set: set:
controller.resources.limits.cpu: 500m controller.resources.limits.cpu: 500m
controller.resources.limits.memory: 512Mi controller.resources.limits.memory: 512Mi
kind: Vanilla
asserts: asserts:
- equal: - equal:
path: spec.template.spec.containers[0].resources.limits.cpu path: spec.template.spec.containers[0].resources.limits.cpu

View File

@ -14,4 +14,4 @@ tests:
of: HorizontalPodAutoscaler of: HorizontalPodAutoscaler
- equal: - equal:
path: metadata.name path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-controller

View File

@ -14,4 +14,4 @@ tests:
of: ScaledObject of: ScaledObject
- equal: - equal:
path: metadata.name path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-controller

View File

@ -20,4 +20,4 @@ tests:
of: NetworkPolicy of: NetworkPolicy
- equal: - equal:
path: metadata.name path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-controller

View File

@ -22,4 +22,4 @@ tests:
of: Service of: Service
- equal: - equal:
path: metadata.name path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller-internal value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-controller-internal

View File

@ -20,4 +20,4 @@ tests:
of: Service of: Service
- equal: - equal:
path: metadata.name path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller-metrics value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-controller-metrics

View File

@ -20,7 +20,7 @@ tests:
of: Service of: Service
- equal: - equal:
path: metadata.name path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-controller
- it: should create a Service of type "NodePort" if `controller.service.external.enabled` is true and `controller.service.type` is "NodePort" - it: should create a Service of type "NodePort" if `controller.service.external.enabled` is true and `controller.service.type` is "NodePort"
set: set:

View File

@ -20,7 +20,7 @@ tests:
of: Service of: Service
- equal: - equal:
path: metadata.name path: metadata.name
value: RELEASE-NAME-ingress-nginx-defaultbackend value: RELEASE-NAME-open-appsec-k8s-nginx-ingress-defaultbackend
- it: should create a Service with port 80 if `defaultBackend.service.port` is 80 - it: should create a Service with port 80 if `defaultBackend.service.port` is 80
set: set: