mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
75 lines
1.9 KiB
YAML
75 lines
1.9 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: custom name suffix with template should pass
|
|
values:
|
|
- ../_values/service_main_default.yaml
|
|
set:
|
|
service.main.nameOverride: "{{ .Release.Name }}"
|
|
asserts:
|
|
- documentIndex: &ServiceDocument 1
|
|
isKind:
|
|
of: Service
|
|
- documentIndex: *ServiceDocument
|
|
equal:
|
|
path: metadata.name
|
|
value: RELEASE-NAME
|
|
|
|
- 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
|