mirror of
https://github.com/truecharts/library-charts.git
synced 2026-07-05 19:49:33 -03:00
update test style
This commit is contained in:
@@ -14,12 +14,14 @@ tests:
|
||||
- it: should pass with controller and global annotations
|
||||
set:
|
||||
some_key: some_value
|
||||
controller.annotations:
|
||||
controller_key: controller_value
|
||||
controller_key2: "{{ .Values.some_key }}"
|
||||
global.annotations:
|
||||
global_key: global_value
|
||||
global_key2: "{{ .Values.some_key }}"
|
||||
controller:
|
||||
annotations:
|
||||
controller_key: controller_value
|
||||
controller_key2: "{{ .Values.some_key }}"
|
||||
global:
|
||||
annotations:
|
||||
global_key: global_value
|
||||
global_key2: "{{ .Values.some_key }}"
|
||||
asserts:
|
||||
- equal:
|
||||
documentIndex: *deploymentDoc
|
||||
@@ -44,8 +46,9 @@ tests:
|
||||
- it: should pass with podAnnotations set
|
||||
set:
|
||||
some_key: some_value2
|
||||
podAnnotations.test: some_value
|
||||
podAnnotations.test2: "{{ .Values.some_key }}"
|
||||
podAnnotations:
|
||||
test: some_value
|
||||
test2: "{{ .Values.some_key }}"
|
||||
asserts:
|
||||
- equal:
|
||||
documentIndex: *deploymentDoc
|
||||
|
||||
@@ -29,9 +29,11 @@ tests:
|
||||
|
||||
- it: should pass with controller strategy changed and rollingUpdate strategies set
|
||||
set:
|
||||
controller.strategy: RollingUpdate
|
||||
controller.rollingUpdate.unavailable: 2
|
||||
controller.rollingUpdate.surge: 3
|
||||
controller:
|
||||
strategy: RollingUpdate
|
||||
rollingUpdate:
|
||||
unavailable: 2
|
||||
surge: 3
|
||||
asserts:
|
||||
- equal:
|
||||
documentIndex: *deploymentDoc
|
||||
@@ -46,14 +48,16 @@ tests:
|
||||
|
||||
- it: should pass with controller disabled
|
||||
set:
|
||||
controller.enabled: false
|
||||
controller:
|
||||
enabled: false
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
|
||||
- it: should pass with controller strategy changed
|
||||
set:
|
||||
controller.strategy: RollingUpdate
|
||||
controller:
|
||||
strategy: RollingUpdate
|
||||
asserts:
|
||||
- equal:
|
||||
documentIndex: *deploymentDoc
|
||||
@@ -65,14 +69,16 @@ tests:
|
||||
|
||||
- it: should fail with wrong controller
|
||||
set:
|
||||
controller.type: not_valid_controller
|
||||
controller:
|
||||
type: not_valid_controller
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: Not a valid controller.type (not_valid_controller)
|
||||
|
||||
- it: should fail with wrong strategy
|
||||
set:
|
||||
controller.strategy: not_valid_strategy
|
||||
controller:
|
||||
strategy: not_valid_strategy
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: Not a valid strategy type for Deployment (not_valid_strategy)
|
||||
|
||||
@@ -31,12 +31,14 @@ tests:
|
||||
- it: should pass with controller and global labels
|
||||
set:
|
||||
some_key: some_value
|
||||
controller.labels:
|
||||
controller_key: controller_value
|
||||
controller_key2: "{{ .Values.some_key }}"
|
||||
global.labels:
|
||||
global_key: global_value
|
||||
global_key2: "{{ .Values.some_key }}"
|
||||
controller:
|
||||
labels:
|
||||
controller_key: controller_value
|
||||
controller_key2: "{{ .Values.some_key }}"
|
||||
global:
|
||||
labels:
|
||||
global_key: global_value
|
||||
global_key2: "{{ .Values.some_key }}"
|
||||
asserts:
|
||||
- equal:
|
||||
documentIndex: *deploymentDoc
|
||||
@@ -58,8 +60,9 @@ tests:
|
||||
- it: should pass with podLabels set
|
||||
set:
|
||||
some_key: some_value2
|
||||
podLabels.test: some_value
|
||||
podLabels.test2: "{{ .Values.some_key }}"
|
||||
podLabels:
|
||||
test: some_value
|
||||
test2: "{{ .Values.some_key }}"
|
||||
asserts:
|
||||
- equal:
|
||||
documentIndex: *deploymentDoc
|
||||
|
||||
@@ -24,7 +24,8 @@ tests:
|
||||
- it: should pass with global.nameOverride
|
||||
set:
|
||||
nameOverride: overrodeName
|
||||
global.nameOverride: globalOverrodeName
|
||||
global:
|
||||
nameOverride: globalOverrodeName
|
||||
asserts:
|
||||
- equal:
|
||||
documentIndex: *deploymentDoc
|
||||
|
||||
@@ -141,54 +141,98 @@ tests:
|
||||
|
||||
- it: should fail with wrong persistence type
|
||||
set:
|
||||
persistence.some_volume.type: not_valid_persistence
|
||||
persistence.some_volume.enabled: true
|
||||
persistence:
|
||||
some_volume:
|
||||
type: not_valid_persistence
|
||||
enabled: true
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: Not a valid persistence.type (not_valid_persistence)
|
||||
|
||||
- it: should fail with not set objectName on configMaps
|
||||
set:
|
||||
persistence.some_volume.type: configMap
|
||||
persistence.some_volume.enabled: true
|
||||
persistence:
|
||||
some_volume:
|
||||
type: configMap
|
||||
enabled: true
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: objectName not set for persistence item some_volume
|
||||
|
||||
- it: should fail with not set objectName on secrets
|
||||
set:
|
||||
persistence.some_volume.type: secret
|
||||
persistence.some_volume.enabled: true
|
||||
persistence:
|
||||
some_volume:
|
||||
type: secret
|
||||
enabled: true
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: objectName not set for persistence item some_volume
|
||||
|
||||
- it: should fail with not set path on hostPath
|
||||
set:
|
||||
persistence.some_volume.type: hostPath
|
||||
persistence.some_volume.enabled: true
|
||||
persistence:
|
||||
some_volume:
|
||||
type: hostPath
|
||||
enabled: true
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: hostPath not set on item some_volume
|
||||
|
||||
- it: should fail with not set server on nfs
|
||||
set:
|
||||
persistence.some_volume.type: nfs
|
||||
persistence.some_volume.enabled: true
|
||||
persistence.some_volume.path: some_path
|
||||
persistence:
|
||||
some_volume:
|
||||
type: nfs
|
||||
enabled: true
|
||||
path: some_path
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: NFS Server not set on item some_volume
|
||||
|
||||
- it: should fail with not set path on nfs
|
||||
set:
|
||||
persistence.some_volume.type: nfs
|
||||
persistence.some_volume.enabled: true
|
||||
persistence.some_volume.server: some_server
|
||||
persistence:
|
||||
some_volume:
|
||||
type: nfs
|
||||
enabled: true
|
||||
server: some_server
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: NFS Path not set on item some_volume
|
||||
|
||||
- it: should fail with not set objectName on secret
|
||||
set:
|
||||
persistence:
|
||||
some_volume:
|
||||
type: secret
|
||||
enabled: true
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: objectName not set for persistence item some_volume
|
||||
|
||||
- it: should fail with not set objectName on configmap
|
||||
set:
|
||||
persistence:
|
||||
some_volume:
|
||||
type: configMap
|
||||
enabled: true
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: objectName not set for persistence item some_volume
|
||||
|
||||
- it: should pass with added configmap
|
||||
set:
|
||||
persistence:
|
||||
some_volume:
|
||||
type: configMap
|
||||
enabled: true
|
||||
objectName: some_name
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: objectName not set for persistence item some_volume
|
||||
|
||||
|
||||
# TODO: configmap
|
||||
# TODO: secret
|
||||
# TODO: PVC
|
||||
|
||||
Reference in New Issue
Block a user