spec_test.yaml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. suite: deployment 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: Deployment
  12. podSpec: {}
  13. asserts:
  14. - documentIndex: &deploymentDoc 0
  15. isKind:
  16. of: Deployment
  17. - documentIndex: *deploymentDoc
  18. isAPIVersion:
  19. of: apps/v1
  20. - documentIndex: *deploymentDoc
  21. isSubset:
  22. path: spec
  23. content:
  24. replicas: 1
  25. revisionHistoryLimit: 3
  26. strategy:
  27. type: Recreate
  28. - it: should apply spec correctly
  29. set:
  30. workload:
  31. workload-name:
  32. enabled: true
  33. primary: true
  34. type: Deployment
  35. replicas: 2
  36. revisionHistoryLimit: 4
  37. strategy: RollingUpdate
  38. rollingUpdate:
  39. maxSurge: 5
  40. maxUnavailable: 5
  41. podSpec: {}
  42. asserts:
  43. - documentIndex: *deploymentDoc
  44. isSubset:
  45. path: spec
  46. content:
  47. replicas: 2
  48. revisionHistoryLimit: 4
  49. strategy:
  50. type: RollingUpdate
  51. rollingUpdate:
  52. maxSurge: 5
  53. maxUnavailable: 5
  54. - it: should apply maxSurge with 0
  55. set:
  56. workload:
  57. workload-name:
  58. enabled: true
  59. primary: true
  60. type: Deployment
  61. strategy: RollingUpdate
  62. rollingUpdate:
  63. maxSurge: 0
  64. podSpec: {}
  65. asserts:
  66. - documentIndex: *deploymentDoc
  67. isSubset:
  68. path: spec
  69. content:
  70. strategy:
  71. type: RollingUpdate
  72. rollingUpdate:
  73. maxSurge: 0
  74. - it: should apply maxUnavailable with 0
  75. set:
  76. workload:
  77. workload-name:
  78. enabled: true
  79. primary: true
  80. type: Deployment
  81. strategy: RollingUpdate
  82. rollingUpdate:
  83. maxUnavailable: 0
  84. podSpec: {}
  85. asserts:
  86. - documentIndex: *deploymentDoc
  87. isSubset:
  88. path: spec
  89. content:
  90. strategy:
  91. type: RollingUpdate
  92. rollingUpdate:
  93. maxUnavailable: 0