mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-03 16:37:04 +02:00
107 lines
2.4 KiB
YAML
107 lines
2.4 KiB
YAML
---
|
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
|
suite: configMap names
|
|
templates:
|
|
- common.yaml
|
|
tests:
|
|
- it: default should pass
|
|
asserts:
|
|
- hasDocuments:
|
|
count: 1
|
|
- documentIndex: 0
|
|
not: true
|
|
isKind:
|
|
of: ConfigMap
|
|
|
|
- it: with disabled configMap should pass
|
|
set:
|
|
configMaps:
|
|
config:
|
|
enabled: false
|
|
data:
|
|
test: test
|
|
asserts:
|
|
- hasDocuments:
|
|
count: 1
|
|
- documentIndex: 0
|
|
not: true
|
|
isKind:
|
|
of: ConfigMap
|
|
|
|
- it: with multiple configMap should pass
|
|
set:
|
|
configMaps:
|
|
config:
|
|
data:
|
|
foo: bar
|
|
secondary:
|
|
data:
|
|
test: test
|
|
asserts:
|
|
- hasDocuments:
|
|
count: 3
|
|
- documentIndex: &FirstConfigmapDocument 1
|
|
isKind:
|
|
of: ConfigMap
|
|
- documentIndex: *FirstConfigmapDocument
|
|
isNotNullOrEmpty:
|
|
path: metadata.name
|
|
- documentIndex: &SecondConfigmapDocument 2
|
|
isKind:
|
|
of: ConfigMap
|
|
- documentIndex: *SecondConfigmapDocument
|
|
isNotNullOrEmpty:
|
|
path: metadata.name
|
|
|
|
- it: default name should pass
|
|
set:
|
|
configMaps:
|
|
config:
|
|
data:
|
|
test: test
|
|
asserts:
|
|
- hasDocuments:
|
|
count: 2
|
|
- documentIndex: &ConfigmapDocument 1
|
|
isKind:
|
|
of: ConfigMap
|
|
- documentIndex: *ConfigmapDocument
|
|
equal:
|
|
path: metadata.name
|
|
value: RELEASE-NAME-config
|
|
|
|
- it: with nameOverride should pass
|
|
set:
|
|
configMaps:
|
|
config:
|
|
data:
|
|
test: test
|
|
nameOverride: http
|
|
asserts:
|
|
- hasDocuments:
|
|
count: 2
|
|
- documentIndex: &ConfigmapDocument 1
|
|
isKind:
|
|
of: ConfigMap
|
|
- documentIndex: *ConfigmapDocument
|
|
equal:
|
|
path: metadata.name
|
|
value: RELEASE-NAME-http
|
|
|
|
- it: with templated nameOverride should pass
|
|
set:
|
|
configMaps:
|
|
config:
|
|
data:
|
|
test: test
|
|
nameOverride: "{{ .Release.Name }}"
|
|
asserts:
|
|
- hasDocuments:
|
|
count: 2
|
|
- documentIndex: &ConfigmapDocument 1
|
|
isKind:
|
|
of: ConfigMap
|
|
- documentIndex: *ConfigmapDocument
|
|
equal:
|
|
path: metadata.name
|
|
value: RELEASE-NAME
|