123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- suite: cronjob validation test
- templates:
- - common.yaml
- tests:
- - it: should fail with invalid concurrencyPolicy
- set:
- workload:
- workload-name:
- enabled: true
- primary: true
- type: CronJob
- concurrencyPolicy: not-a-policy
- podSpec: {}
- asserts:
- - failedTemplate:
- errorMessage: CronJob - Expected <concurrencyPolicy> to be one of [Allow, Forbid, Replace], but got [not-a-policy]
- - it: should fail with empty schedule
- set:
- workload:
- workload-name:
- enabled: true
- primary: true
- type: CronJob
- schedule:
- podSpec: {}
- asserts:
- - failedTemplate:
- errorMessage: CronJob - Expected non-empty <schedule>
- - it: should fail with restartPolicy set to Always
- set:
- workload:
- workload-name:
- enabled: true
- primary: true
- type: CronJob
- schedule: "* * * * *"
- restartPolicy: Always
- podSpec: {}
- asserts:
- - failedTemplate:
- errorMessage: Expected <restartPolicy to be [OnFailure, Never] for [CronJob] but got [Always]
- - it: should fail with invalid completionMode (make sure job validation kicks in)
- set:
- workload:
- workload-name:
- enabled: true
- primary: true
- type: CronJob
- schedule: "* * * * *"
- completionMode: not-a-mode
- podSpec: {}
- asserts:
- - failedTemplate:
- errorMessage: Job - Expected <completionMode> to be one of [Indexed, NonIndexed], but got [not-a-mode]
|