mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
Co-authored-by: lab-assistant[bot] <180935599+lab-assistant[bot]@users.noreply.github.com>
55 lines
1.8 KiB
YAML
55 lines
1.8 KiB
YAML
---
|
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
|
suite: ingress - validations
|
|
templates:
|
|
- common.yaml
|
|
values:
|
|
- ../_values/controllers_main_default_container.yaml
|
|
tests:
|
|
- it: service reference to non-existing service should fail
|
|
set:
|
|
ingress.main.hosts:
|
|
- host: "chart-example.local"
|
|
paths:
|
|
- path: /
|
|
service:
|
|
identifier: main
|
|
port: 8081
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: "No enabled Service found with this identifier. (ingress: 'main', path: '/', identifier: 'main')"
|
|
|
|
- it: automatic service determination should fail when no service is enabled
|
|
set:
|
|
ingress.main.hosts:
|
|
- host: "chart-example.local"
|
|
paths:
|
|
- path: /
|
|
service:
|
|
port: 8081
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: "Either service.name or service.identifier is required because automatic Service detection is not possible. (ingress: main, host: chart-example.local, path: /)"
|
|
|
|
- it: automatic service determination should fail when >1 service is enabled
|
|
set:
|
|
service:
|
|
main:
|
|
controller: main
|
|
ports:
|
|
ui:
|
|
port: 8082
|
|
second:
|
|
controller: main
|
|
ports:
|
|
ui:
|
|
port: 8082
|
|
ingress.main.hosts:
|
|
- host: "chart-example.local"
|
|
paths:
|
|
- path: /
|
|
service:
|
|
port: 8081
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: "Either service.name or service.identifier is required because automatic Service detection is not possible. (ingress: main, host: chart-example.local, path: /)"
|