mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-03 08:37:03 +02:00
66 lines
1.6 KiB
YAML
66 lines
1.6 KiB
YAML
---
|
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
|
suite: pvc names
|
|
templates:
|
|
- common.yaml
|
|
|
|
set:
|
|
persistence.config:
|
|
accessMode: ReadWriteOnce
|
|
size: 1Gi
|
|
|
|
tests:
|
|
- it: disabled should pass
|
|
set:
|
|
persistence.config.enabled: false
|
|
asserts:
|
|
- hasDocuments:
|
|
count: 1
|
|
- documentIndex: 0
|
|
not: true
|
|
isKind:
|
|
of: PersistentVolumeClaim
|
|
|
|
- it: enabled should pass
|
|
set:
|
|
persistence.config.enabled: true
|
|
asserts:
|
|
- hasDocuments:
|
|
count: 2
|
|
- documentIndex: &PersistentVolumeClaimDocument 0
|
|
isKind:
|
|
of: PersistentVolumeClaim
|
|
- documentIndex: 1
|
|
not: true
|
|
isKind:
|
|
of: PersistentVolumeClaim
|
|
- documentIndex: *PersistentVolumeClaimDocument
|
|
equal:
|
|
path: metadata.name
|
|
value: RELEASE-NAME-config
|
|
|
|
- it: without suffix should pass
|
|
set:
|
|
persistence.config:
|
|
nameOverride: "-"
|
|
asserts:
|
|
- documentIndex: &PersistentVolumeClaimDocument 0
|
|
isKind:
|
|
of: PersistentVolumeClaim
|
|
- documentIndex: *PersistentVolumeClaimDocument
|
|
equal:
|
|
path: metadata.name
|
|
value: RELEASE-NAME
|
|
|
|
- it: with custom suffix should pass
|
|
set:
|
|
persistence.config:
|
|
nameOverride: "custom"
|
|
asserts:
|
|
- documentIndex: &PersistentVolumeClaimDocument 0
|
|
isKind:
|
|
of: PersistentVolumeClaim
|
|
- documentIndex: *PersistentVolumeClaimDocument
|
|
equal:
|
|
path: metadata.name
|
|
value: RELEASE-NAME-custom
|