helm-charts/charts/library/common-test/tests/persistence/volumes_test.yaml
Bernd Schorgers 3d3028b889
feat(common): Release v2.4.0 (#245)
Signed-off-by: Christopher Larivière <lariviere.c@gmail.com>
Co-authored-by: Christopher Larivière <lariviere.c@gmail.com>
Co-authored-by: Markus Reiter <me@reitermark.us>
2023-12-10 08:56:08 +00:00

109 lines
2.9 KiB
YAML

---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: persistence volumes
templates:
- common.yaml
tests:
- it: no persistence should pass
asserts:
- documentIndex: &DeploymentDoc 0
isKind:
of: Deployment
- documentIndex: *DeploymentDoc
notExists:
path: spec.template.spec.volumes
- it: default should pass
set:
persistence:
config:
enabled: true
asserts:
- documentIndex: &DeploymentDoc 1
isKind:
of: Deployment
- documentIndex: *DeploymentDoc
equal:
path: spec.template.spec.volumes
value:
- name: config
persistentVolumeClaim:
claimName: RELEASE-NAME-config
- it: advanced mount config should pass
set:
controllers:
main:
containers:
second-container:
image:
repository: ghcr.io/mendhak/http-https-echo
tag: 31
second:
containers:
first-container:
image:
repository: ghcr.io/mendhak/http-https-echo
tag: 31
persistence:
config:
enabled: true
existingClaim: test
advancedMounts:
main:
main:
- path: /config
readOnly: false
data:
type: configMap
name: myConfigMap
globalMounts:
- path: /globalTest
advancedMounts:
main:
main:
- path: /data/config.yaml
readOnly: false
subPath: config.yaml
second-container:
- path: /appdata/config
readOnly: true
second:
first-container:
- path: /second-pod/config.yaml
readOnly: false
subPath: config.yaml
no-mounts:
existingClaim: test
asserts:
- documentIndex: &FirstDeploymentDoc 0
isKind:
of: Deployment
- documentIndex: *FirstDeploymentDoc
equal:
path: spec.template.spec.volumes
value:
- name: config
persistentVolumeClaim:
claimName: test
- configMap:
name: myConfigMap
name: data
- name: no-mounts
persistentVolumeClaim:
claimName: test
- documentIndex: &SecondDeploymentDoc 1
isKind:
of: Deployment
- documentIndex: *SecondDeploymentDoc
equal:
path: spec.template.spec.volumes
value:
- configMap:
name: myConfigMap
name: data
- name: no-mounts
persistentVolumeClaim:
claimName: test