--- # yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json suite: ingress values templates: - common.yaml values: - ../_values/ingress_main_default_hosts.yaml - ../_values/service_main_default.yaml - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: - documentIndex: &IngressDocument 2 isKind: of: Ingress - documentIndex: *IngressDocument equal: path: spec.rules[0].host value: chart-example.local - documentIndex: *IngressDocument equal: path: spec.rules[0].http.paths[0].path value: "/" - it: nameOverride should pass set: ingress.main: nameOverride: test asserts: - documentIndex: &IngressDocument 2 isKind: of: Ingress - documentIndex: *IngressDocument equal: path: metadata.name value: RELEASE-NAME-test - it: nameOverride with template should pass set: ingress.main: nameOverride: "{{ .Release.Name }}" asserts: - documentIndex: &IngressDocument 2 isKind: of: Ingress - documentIndex: *IngressDocument equal: path: metadata.name value: RELEASE-NAME - it: custom host and path should pass set: ingress.main: hosts: - host: chart-test.local paths: - path: /test service: identifier: main asserts: - documentIndex: &IngressDocument 2 isKind: of: Ingress - documentIndex: *IngressDocument equal: path: spec.rules[0].host value: chart-test.local - documentIndex: *IngressDocument equal: path: spec.rules[0].http.paths[0].path value: "/test" - it: host with template should pass set: ingress.main: hosts: - host: "{{ .Release.Name }}.hostname" paths: - path: / service: identifier: main port: http asserts: - documentIndex: &IngressDocument 2 isKind: of: Ingress - documentIndex: *IngressDocument equal: path: spec.rules[0].host value: RELEASE-NAME.hostname - it: path with template should pass set: ingress.main: hosts: - host: chart-test.local paths: - path: "/{{ .Release.Name }}.path" service: identifier: main asserts: - documentIndex: &IngressDocument 2 isKind: of: Ingress - documentIndex: *IngressDocument equal: path: spec.rules[0].http.paths[0].path value: "/RELEASE-NAME.path" - it: with defaultBackend should pass set: ingress.main: defaultBackend: test asserts: - documentIndex: &IngressDocument 2 isKind: of: Ingress - documentIndex: *IngressDocument equal: path: spec.defaultBackend value: test - documentIndex: *IngressDocument notExists: path: spec.rules