validation_test.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. suite: cronjob validation test
  2. templates:
  3. - common.yaml
  4. tests:
  5. - it: should fail with invalid concurrencyPolicy
  6. set:
  7. workload:
  8. workload-name:
  9. enabled: true
  10. primary: true
  11. type: CronJob
  12. concurrencyPolicy: not-a-policy
  13. podSpec: {}
  14. asserts:
  15. - failedTemplate:
  16. errorMessage: CronJob - Expected <concurrencyPolicy> to be one of [Allow, Forbid, Replace], but got [not-a-policy]
  17. - it: should fail with empty schedule
  18. set:
  19. workload:
  20. workload-name:
  21. enabled: true
  22. primary: true
  23. type: CronJob
  24. schedule:
  25. podSpec: {}
  26. asserts:
  27. - failedTemplate:
  28. errorMessage: CronJob - Expected non-empty <schedule>
  29. - it: should fail with invalid completionMode (make sure job validation kicks in)
  30. set:
  31. workload:
  32. workload-name:
  33. enabled: true
  34. primary: true
  35. type: CronJob
  36. schedule: "* * * * *"
  37. completionMode: not-a-mode
  38. podSpec: {}
  39. asserts:
  40. - failedTemplate:
  41. errorMessage: Job - Expected <completionMode> to be one of [Indexed, NonIndexed], but got [not-a-mode]