helm-charts/charts/other/app-template/tests/service/port_names_test.yaml
2022-08-08 15:05:46 +02:00

63 lines
1.4 KiB
YAML

suite: service port names
templates:
- common.yaml
tests:
- it: default should pass
asserts:
- hasDocuments:
count: 2
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- documentIndex: *ServiceDocument
equal:
path: spec.ports[0]
value:
name: http
port: null
protocol: TCP
targetPort: http
- it: custom name should pass
set:
service:
main:
ports:
http:
enabled: false
server:
enabled: true
port: 8080
asserts:
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- documentIndex: *ServiceDocument
equal:
path: spec.ports[0]
value:
name: server
port: 8080
protocol: TCP
targetPort: server
- it: custom target port should pass
set:
service:
main:
ports:
http:
enabled: true
targetPort: 80
asserts:
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- documentIndex: *ServiceDocument
equal:
path: spec.ports[0]
value:
name: http
port: null
protocol: TCP
targetPort: 80