validation_test.yaml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. suite: job validation test
  2. templates:
  3. - common.yaml
  4. tests:
  5. - it: should fail with invalid completionMode
  6. set:
  7. workload:
  8. workload-name:
  9. enabled: true
  10. primary: true
  11. type: Job
  12. completionMode: not-a-mode
  13. podSpec: {}
  14. asserts:
  15. - failedTemplate:
  16. errorMessage: Job - Expected <completionMode> to be one of [Indexed, NonIndexed], but got [not-a-mode]
  17. - it: should fail with invalid completionMode
  18. set:
  19. workload:
  20. workload-name:
  21. enabled: true
  22. primary: true
  23. type: Job
  24. completionMode: not-a-mode
  25. podSpec: {}
  26. asserts:
  27. - failedTemplate:
  28. errorMessage: Job - Expected <completionMode> to be one of [Indexed, NonIndexed], but got [not-a-mode]
  29. - it: should fail with restartPolicy set to Always
  30. set:
  31. workload:
  32. workload-name:
  33. enabled: true
  34. primary: true
  35. type: Job
  36. restartPolicy: Always
  37. podSpec: {}
  38. asserts:
  39. - failedTemplate:
  40. errorMessage: Expected <restartPolicy to be [OnFailure, Never] for [Job] but got [Always]
  41. - it: should fail with completionMode to Indexed and no parallelism
  42. set:
  43. workload:
  44. workload-name:
  45. enabled: true
  46. primary: true
  47. type: Job
  48. completionMode: Indexed
  49. completions: 5
  50. parallelism:
  51. podSpec: {}
  52. asserts:
  53. - failedTemplate:
  54. errorMessage: Job - Expected <parallelism> to be set when <completionMode> is set to [Indexed]