helm-charts/charts/library/common-test/tests/service/names_test.yaml
2024-03-08 08:51:40 +01:00

61 lines
1.5 KiB
YAML

---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: service names
templates:
- common.yaml
tests:
- it: default should pass
values:
- ../_values/service_main_default.yaml
asserts:
- hasDocuments:
count: 2
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- documentIndex: *ServiceDocument
equal:
path: metadata.name
value: RELEASE-NAME
- it: custom name suffix should pass
values:
- ../_values/service_main_default.yaml
set:
service.main.nameOverride: http
asserts:
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- documentIndex: *ServiceDocument
equal:
path: metadata.name
value: RELEASE-NAME-http
- it: multiple should pass
values:
- ../_values/service_main_default.yaml
set:
service:
second:
controller: main
ports:
ui:
port: 8082
asserts:
- hasDocuments:
count: 3
- documentIndex: &ServiceDocumentFirst 1
isKind:
of: Service
- documentIndex: *ServiceDocumentFirst
equal:
path: metadata.name
value: RELEASE-NAME-main
- documentIndex: &ServiceDocumentSecond 2
isKind:
of: Service
- documentIndex: *ServiceDocumentSecond
equal:
path: metadata.name
value: RELEASE-NAME-second