Add unit tests for Helm chart

Signed-off-by: Ricardo Lopes <ricardoapl.dev@gmail.com>
This commit is contained in:
Ricardo Lopes 2024-05-13 16:33:02 +01:00
parent 02776b42a5
commit e1a3194694
2 changed files with 32 additions and 0 deletions

View file

@ -196,3 +196,18 @@ tests:
- equal: - equal:
path: spec.template.spec.automountServiceAccountToken path: spec.template.spec.automountServiceAccountToken
value: false value: false
- it: should create a Deployment with extraPorts if `defaultBackend.service.extraPorts` is set
set:
defaultBackend.enabled: true
defaultBackend.service.extraPorts[0]:
name: example
protocol: TCP
targetPort: 9999
asserts:
- contains:
path: spec.template.spec.containers[0].ports
content:
name: example
protocol: TCP
containerPort: 9999

View file

@ -50,3 +50,20 @@ tests:
value: value:
- 10.0.0.1 - 10.0.0.1
- fd00::1 - fd00::1
- it: should create a Service with extraPorts if `defaultBackend.service.extraPorts` is set
set:
defaultBackend.enabled: true
defaultBackend.service.extraPorts[0]:
name: example
port: 8888
protocol: TCP
targetPort: 65535
asserts:
- contains:
path: spec.ports
content:
name: example
port: 8888
protocol: TCP
targetPort: 65535