mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 17:07:04 +02:00
62 lines
1.6 KiB
YAML
62 lines
1.6 KiB
YAML
---
|
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
|
suite: route presence
|
|
templates:
|
|
- common.yaml
|
|
values:
|
|
- ../_values/controllers_main_default_container.yaml
|
|
tests:
|
|
- it: an HTTPRoute is not created by default
|
|
asserts:
|
|
- not: true
|
|
containsDocument:
|
|
kind: HTTPRoute
|
|
apiVersion: gateway.networking.k8s.io/v1alpha2
|
|
name: RELEASE-NAME
|
|
|
|
- it: an HTTPRoute is not created when disabled
|
|
set:
|
|
route.main.enabled: false
|
|
asserts:
|
|
- not: true
|
|
containsDocument:
|
|
kind: HTTPRoute
|
|
apiVersion: gateway.networking.k8s.io/v1alpha2
|
|
name: RELEASE-NAME
|
|
|
|
- it: an HTTPRoute is created when explicitly enabled
|
|
set:
|
|
route.main:
|
|
enabled: true
|
|
parentRefs:
|
|
- name: test
|
|
namespace: test
|
|
documentSelector:
|
|
path: $[?(@.kind == "HTTPRoute")].metadata.name
|
|
value: RELEASE-NAME
|
|
asserts:
|
|
- exists:
|
|
path: metadata.name
|
|
|
|
- it: multiple HTTPRoute are created when configured
|
|
set:
|
|
route:
|
|
main:
|
|
parentRefs:
|
|
- name: main
|
|
namespace: main
|
|
test:
|
|
parentRefs:
|
|
- name: test
|
|
namespace: test
|
|
asserts:
|
|
- documentSelector:
|
|
path: $[?(@.kind == "HTTPRoute")].metadata.name
|
|
value: RELEASE-NAME-main
|
|
exists:
|
|
path: metadata.name
|
|
- documentSelector:
|
|
path: $[?(@.kind == "HTTPRoute")].metadata.name
|
|
value: RELEASE-NAME-test
|
|
exists:
|
|
path: metadata.name
|