mirror of
https://gitea.com/gitea/helm-chart.git
synced 2024-06-02 02:11:23 +05:30
Add unit tests (#601)
This commit is contained in:
parent
b91ea93fb3
commit
7071d71439
52
unittests/deployment/storage-class-configuration.yaml
Normal file
52
unittests/deployment/storage-class-configuration.yaml
Normal file
|
@ -0,0 +1,52 @@
|
|||
# File: tests/gitea-storageclass-tests.yaml
|
||||
|
||||
suite: storage class configuration tests
|
||||
|
||||
release:
|
||||
name: gitea-storageclass-tests
|
||||
namespace: testing
|
||||
|
||||
templates:
|
||||
- templates/gitea/deployment.yaml
|
||||
- templates/gitea/config.yaml
|
||||
- templates/gitea/pvc.yaml
|
||||
|
||||
tests:
|
||||
- it: should set storageClassName when persistence.storageClass is defined
|
||||
template: templates/gitea/deployment.yaml
|
||||
set:
|
||||
persistence.storageClass: "my-storage-class"
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.volumes[0].persistentVolumeClaim.storageClassName
|
||||
content: "my-storage-class"
|
||||
|
||||
- it: should not set storageClassName when persistence.storageClass is not defined
|
||||
template: templates/gitea/deployment.yaml
|
||||
set:
|
||||
persistence.storageClass: null
|
||||
asserts:
|
||||
- notContains:
|
||||
path: spec.template.spec.volumes[0].persistentVolumeClaim.storageClassName
|
||||
any: true
|
||||
content: ".*"
|
||||
|
||||
- it: should set global.storageClass when persistence.storageClass is not defined
|
||||
template: templates/gitea/deployment.yaml
|
||||
set:
|
||||
persistence.storageClass: null
|
||||
global.storageClass: "default-storage-class"
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.volumes[0].persistentVolumeClaim.storageClassName
|
||||
content: "default-storage-class"
|
||||
|
||||
- it: should set storageClassName when persistence.storageClass is defined and global.storageClass is defined
|
||||
template: templates/gitea/deployment.yaml
|
||||
set:
|
||||
global.storageClass: "default-storage-class"
|
||||
persistence.storageClass: "my-storage-class"
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.volumes[0].persistentVolumeClaim.storageClassName
|
||||
content: "my-storage-class"
|
Loading…
Reference in a new issue