helm-charts/charts/library/common-test/tests/secret/names_test.yaml
2024-03-15 08:33:07 +00:00

93 lines
2.1 KiB
YAML

---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: secret names
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
tests:
- it: default should pass
asserts:
- hasDocuments:
count: 1
- documentIndex: 0
not: true
isKind:
of: Secret
- it: with disabled secret should pass
set:
secrets:
secret:
enabled: false
stringData:
test: test
asserts:
- hasDocuments:
count: 1
- documentIndex: 0
not: true
isKind:
of: Secret
- it: with multiple secrets should pass
set:
secrets:
secret:
enabled: true
stringData:
foo: bar
secondary:
enabled: true
stringData:
test: test
asserts:
- hasDocuments:
count: 3
- documentIndex: &FirstSecretDocument 1
isKind:
of: Secret
- documentIndex: *FirstSecretDocument
isNotNullOrEmpty:
path: metadata.name
- documentIndex: &SecondSecretDocument 2
isKind:
of: Secret
- documentIndex: *SecondSecretDocument
isNotNullOrEmpty:
path: metadata.name
- it: default name should pass
set:
secrets:
secret:
stringData:
test: test
asserts:
- hasDocuments:
count: 2
- documentIndex: &SecretDocument 1
isKind:
of: Secret
- documentIndex: *SecretDocument
equal:
path: metadata.name
value: RELEASE-NAME-secret
- it: with nameOverride should pass
set:
secrets:
secret:
stringData:
test: test
nameOverride: http
asserts:
- hasDocuments:
count: 2
- documentIndex: &SecretDocument 1
isKind:
of: Secret
- documentIndex: *SecretDocument
equal:
path: metadata.name
value: RELEASE-NAME-http