names_test.yaml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. suite: workload name test
  2. templates:
  3. - common.yaml
  4. tests:
  5. - it: should generate correct workload name
  6. set:
  7. workload:
  8. workload-name:
  9. enabled: true
  10. primary: true
  11. type: Deployment
  12. podSpec: {}
  13. cronjob-workload-name:
  14. enabled: true
  15. primary: false
  16. type: CronJob
  17. schedule: "*/1 * * * *"
  18. podSpec:
  19. restartPolicy: Never
  20. job-workload-name:
  21. enabled: true
  22. primary: false
  23. type: Job
  24. podSpec:
  25. restartPolicy: Never
  26. asserts:
  27. - documentIndex: &cronJobDoc 0
  28. isKind:
  29. of: CronJob
  30. - documentIndex: *cronJobDoc
  31. isAPIVersion:
  32. of: batch/v1
  33. - documentIndex: *cronJobDoc
  34. equal:
  35. path: metadata.name
  36. value: release-name-common-test-cronjob-workload-name
  37. - documentIndex: &jobDoc 1
  38. isKind:
  39. of: Job
  40. - documentIndex: *jobDoc
  41. isAPIVersion:
  42. of: batch/v1
  43. - documentIndex: *jobDoc
  44. equal:
  45. path: metadata.name
  46. value: release-name-common-test-job-workload-name
  47. - documentIndex: &deploymentDoc 2
  48. isKind:
  49. of: Deployment
  50. - documentIndex: *deploymentDoc
  51. isAPIVersion:
  52. of: apps/v1
  53. - documentIndex: *deploymentDoc
  54. equal:
  55. path: metadata.name
  56. value: release-name-common-test