data_test.yaml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. suite: configmap data test
  2. templates:
  3. - common.yaml
  4. tests:
  5. - it: should pass with key-value data
  6. set:
  7. configmap:
  8. my-configmap1:
  9. enabled: true
  10. data:
  11. foo: bar
  12. asserts:
  13. - documentIndex: &configmapDoc 0
  14. isKind:
  15. of: ConfigMap
  16. - documentIndex: *configmapDoc
  17. equal:
  18. path: data
  19. value:
  20. foo: bar
  21. - it: should pass with key-value data from tpl
  22. set:
  23. data: bar
  24. configmap:
  25. my-configmap1:
  26. enabled: true
  27. data:
  28. foo: "{{ .Values.data }}"
  29. asserts:
  30. - documentIndex: *configmapDoc
  31. equal:
  32. path: data
  33. value:
  34. foo: bar
  35. - it: should pass with scalar data
  36. set:
  37. configmap:
  38. my-configmap1:
  39. enabled: true
  40. data:
  41. foo: |
  42. some multi line
  43. string text
  44. asserts:
  45. - documentIndex: *configmapDoc
  46. equal:
  47. path: data
  48. value:
  49. foo: |
  50. some multi line
  51. string text
  52. - it: should pass with scalar data with tpl
  53. set:
  54. data: Some other text
  55. configmap:
  56. my-configmap:
  57. enabled: true
  58. data:
  59. foo: |
  60. file start
  61. {{ .Values.data }}
  62. asserts:
  63. - documentIndex: *configmapDoc
  64. equal:
  65. path: data
  66. value:
  67. foo: |
  68. file start
  69. Some other text
  70. - it: should pass with scalar data from tpl
  71. set:
  72. data: |
  73. Some other text
  74. some_text
  75. configmap:
  76. my-configmap1:
  77. enabled: true
  78. data:
  79. foo: |
  80. {{- .Values.data | nindent 2 }}
  81. asserts:
  82. - documentIndex: *configmapDoc
  83. equal:
  84. path: data
  85. value:
  86. foo: |
  87. Some other text
  88. some_text