helm-charts/charts/library/common-test/tests/service/port_protocols_test.yaml
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 0eac5ba7d7
feat(common): Release v2.3.0 (#228)
Signed-off-by: Christopher Larivière <lariviere.c@gmail.com>
Co-authored-by: Christopher Larivière <lariviere.c@gmail.com>
2023-11-20 19:33:30 +00:00

80 lines
2 KiB
YAML

---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: service protocols
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].protocol
value: TCP
- it: explicit TCP should pass
set:
service.main.ports.http.protocol: TCP
asserts:
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- documentIndex: *ServiceDocument
equal:
path: spec.ports[0].protocol
value: TCP
- it: explicit UDP should pass
set:
service.main.ports.http.protocol: UDP
asserts:
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- documentIndex: *ServiceDocument
equal:
path: spec.ports[0].protocol
value: UDP
- it: explicit HTTP should pass
set:
service.main.ports.http.protocol: HTTP
asserts:
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- documentIndex: *ServiceDocument
equal:
path: spec.ports[0].protocol
value: TCP
- documentIndex: *ServiceDocument
notExists:
path: metadata.annotations
- it: explicit HTTPS should pass
set:
service.main.ports.http.protocol: HTTPS
asserts:
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- documentIndex: *ServiceDocument
equal:
path: spec.ports[0].protocol
value: TCP
- it: explicit appProtocol should pass
set:
service.main.ports.http.appProtocol: kubernetes.io/h2c
asserts:
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- documentIndex: *ServiceDocument
equal:
path: spec.ports[0].appProtocol
value: kubernetes.io/h2c