--- # yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json suite: service names templates: - common.yaml values: - ../_values/controllers_main_default_container.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