spec_test.yaml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. suite: job spec test
  2. templates:
  3. - common.yaml
  4. tests:
  5. - it: should pass with workload enabled
  6. set:
  7. workload:
  8. workload-name:
  9. enabled: true
  10. primary: true
  11. type: Job
  12. podSpec:
  13. restartPolicy: Never
  14. asserts:
  15. - documentIndex: &jobDoc 0
  16. isKind:
  17. of: Job
  18. - documentIndex: *jobDoc
  19. isAPIVersion:
  20. of: batch/v1
  21. - documentIndex: *jobDoc
  22. isSubset:
  23. path: spec
  24. content:
  25. backoffLimit: 5
  26. completionMode: NonIndexed
  27. completions:
  28. parallelism: 1
  29. ttlSecondsAfterFinished: 120
  30. - it: should apply spec correctly
  31. set:
  32. workload:
  33. workload-name:
  34. enabled: true
  35. primary: true
  36. type: Job
  37. backoffLimit: 5
  38. completionMode: Indexed
  39. completions: 5
  40. parallelism: 5
  41. ttlSecondsAfterFinished: 100
  42. activeDeadlineSeconds: 100
  43. podSpec:
  44. restartPolicy: Never
  45. asserts:
  46. - documentIndex: *jobDoc
  47. isSubset:
  48. path: spec
  49. content:
  50. backoffLimit: 5
  51. completionMode: Indexed
  52. completions: 5
  53. parallelism: 5
  54. ttlSecondsAfterFinished: 100
  55. activeDeadlineSeconds: 100
  56. - it: should set parallelism to 0 on ixChartContext - isStopped (true)
  57. set:
  58. global:
  59. ixChartContext:
  60. storageClassName: some-storage-class
  61. isStopped: true
  62. workload:
  63. workload-name:
  64. enabled: true
  65. primary: true
  66. type: Job
  67. parallelism: 3
  68. podSpec:
  69. restartPolicy: Never
  70. asserts:
  71. - documentIndex: *jobDoc
  72. isSubset:
  73. path: spec
  74. content:
  75. parallelism: 0
  76. - it: should not set parallelism to 0 on ixChartContext - isStopped (false)
  77. set:
  78. global:
  79. ixChartContext:
  80. storageClassName: some-storage-class
  81. isStopped: false
  82. workload:
  83. workload-name:
  84. enabled: true
  85. primary: true
  86. type: Job
  87. parallelism: 3
  88. podSpec:
  89. restartPolicy: Never
  90. asserts:
  91. - documentIndex: *jobDoc
  92. isSubset:
  93. path: spec
  94. content:
  95. parallelism: 3