Files
library-charts/library/common-test/tests/statefulset/controller_test.yaml
Stavros kois 6c7a33ce1c add tests
2023-01-18 15:31:56 +02:00

75 lines
1.8 KiB
YAML

suite: statefulset strategy test
templates:
- common.yaml
tests:
- it: should pass with strategy changed in StatefulSet
documentIndex: &statefulsetDoc 0
set:
controller:
type: StatefulSet
strategy: OnDelete
rollingUpdate:
partition: 5
unavailable: 6
asserts:
- hasDocuments:
count: 3
- isKind:
of: StatefulSet
- equal:
path: spec.updateStrategy
value:
type: OnDelete
- isNull:
path: spec.updateStrategy.rollingUpdate
- it: should pass with strategy changed in StatefulSet
documentIndex: *statefulsetDoc
set:
controller:
type: StatefulSet
strategy: RollingUpdate
rollingUpdate:
partition: 5
unavailable: 6
asserts:
- equal:
path: spec.updateStrategy
value:
type: RollingUpdate
rollingUpdate:
partition: 5
maxUnavailable: 6
- it: should fail with wrong strategy
documentIndex: *statefulsetDoc
set:
controller:
type: StatefulSet
strategy: not_valid_strategy
asserts:
- failedTemplate:
errorMessage: Not a valid strategy type for StatefulSet (not_valid_strategy)
- it: should pass with revisionHistoryLimit changed
documentIndex: *statefulsetDoc
set:
controller:
type: StatefulSet
revisionHistoryLimit: 1
asserts:
- equal:
path: spec.revisionHistoryLimit
value: 1
- it: should pass with replicas changed
documentIndex: *statefulsetDoc
set:
controller:
type: StatefulSet
replicas: 6
asserts:
- equal:
path: spec.replicas
value: 6