helm-charts/charts/library/common-test/tests/route/service_reference_test.yaml
2023-09-14 15:40:49 +02:00

56 lines
1.5 KiB
YAML

---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: ingress service reference
templates:
- common.yaml
tests:
- it: default should pass
set:
route.main:
enabled: true
parentRefs:
- name: parentName
namespace: parentNamespace
asserts:
- documentIndex: &HTTPRouteDocument 2
isKind:
of: HTTPRoute
- documentIndex: *HTTPRouteDocument
equal:
path: spec.rules[0].backendRefs[0]
value:
group: ""
kind: Service
name: RELEASE-NAME
namespace: NAMESPACE
port: 8080
weight: 1
- it: custom service reference should pass
set:
route.main:
enabled: true
parentRefs:
- name: parentName
namespace: parentNamespace
rules:
- backendRefs:
- group: test
name: pathService
port: 1234
namespace: serviceNamespace
weight: 123
asserts:
- documentIndex: &HTTPRouteDocument 2
isKind:
of: HTTPRoute
- documentIndex: *HTTPRouteDocument
equal:
path: spec.rules[0].backendRefs[0]
value:
group: test
kind: Service
name: pathService
namespace: serviceNamespace
port: 1234
weight: 123