|
| 1 | +suite: test conductor resources |
| 2 | +templates: |
| 3 | + - conductor-deployment.yaml |
| 4 | + - conductor-service.yaml |
| 5 | + - conductor-ingress.yaml |
| 6 | + - conductor-config-map.yaml |
| 7 | + - conductor-service-account.yaml |
| 8 | + - conductor-role.yaml |
| 9 | + - conductor-role-binding.yaml |
| 10 | +values: |
| 11 | + - ../../examples/example.yaml |
| 12 | +tests: |
| 13 | + - it: should create conductor deployment with correct configuration |
| 14 | + template: conductor-deployment.yaml |
| 15 | + asserts: |
| 16 | + - isKind: |
| 17 | + of: Deployment |
| 18 | + - equal: |
| 19 | + path: metadata.name |
| 20 | + value: conductor |
| 21 | + - equal: |
| 22 | + path: metadata.labels["app.kubernetes.io/name"] |
| 23 | + value: conductor |
| 24 | + - equal: |
| 25 | + path: metadata.labels["app.kubernetes.io/component"] |
| 26 | + value: backend |
| 27 | + - equal: |
| 28 | + path: metadata.labels["app.kubernetes.io/part-of"] |
| 29 | + value: debezium-platform |
| 30 | + - equal: |
| 31 | + path: spec.replicas |
| 32 | + value: 1 |
| 33 | + - equal: |
| 34 | + path: spec.strategy.type |
| 35 | + value: Recreate |
| 36 | + - equal: |
| 37 | + path: spec.selector.matchLabels["app.kubernetes.io/name"] |
| 38 | + value: conductor |
| 39 | + - equal: |
| 40 | + path: spec.template.spec.serviceAccountName |
| 41 | + value: conductor-service-account |
| 42 | + - equal: |
| 43 | + path: spec.template.spec.containers[0].name |
| 44 | + value: conductor |
| 45 | + - equal: |
| 46 | + path: spec.template.spec.containers[0].ports[0].containerPort |
| 47 | + value: 8080 |
| 48 | + - isNotEmpty: |
| 49 | + path: spec.template.spec.containers[0].image |
| 50 | + - isNotEmpty: |
| 51 | + path: spec.template.spec.containers[0].env |
| 52 | + - contains: |
| 53 | + path: spec.template.spec.containers[0].env |
| 54 | + content: |
| 55 | + name: CONDUCTOR_WATCHER_OFFSET_STORAGE_TYPE |
| 56 | + value: io.debezium.storage.configmap.ConfigMapOffsetStore |
| 57 | + - lengthEqual: |
| 58 | + path: spec.template.spec.containers[0].env |
| 59 | + count: 7 |
| 60 | + |
| 61 | + - it: should create conductor service with correct ports |
| 62 | + template: conductor-service.yaml |
| 63 | + asserts: |
| 64 | + - isKind: |
| 65 | + of: Service |
| 66 | + - equal: |
| 67 | + path: metadata.name |
| 68 | + value: conductor |
| 69 | + - equal: |
| 70 | + path: metadata.labels["app.kubernetes.io/name"] |
| 71 | + value: conductor |
| 72 | + - equal: |
| 73 | + path: metadata.labels["app.kubernetes.io/component"] |
| 74 | + value: backend |
| 75 | + - equal: |
| 76 | + path: spec.selector["app.kubernetes.io/name"] |
| 77 | + value: conductor |
| 78 | + - equal: |
| 79 | + path: spec.ports[0].name |
| 80 | + value: conductor-port |
| 81 | + - equal: |
| 82 | + path: spec.ports[0].port |
| 83 | + value: 8080 |
| 84 | + - equal: |
| 85 | + path: spec.ports[0].targetPort |
| 86 | + value: 8080 |
| 87 | + |
| 88 | + - it: should create conductor ingress with correct routing |
| 89 | + template: conductor-ingress.yaml |
| 90 | + asserts: |
| 91 | + - isKind: |
| 92 | + of: Ingress |
| 93 | + - equal: |
| 94 | + path: metadata.name |
| 95 | + value: conductor-ingress |
| 96 | + - isNotEmpty: |
| 97 | + path: spec.rules[0].host |
| 98 | + - equal: |
| 99 | + path: spec.rules[0].http.paths[0].path |
| 100 | + value: / |
| 101 | + - equal: |
| 102 | + path: spec.rules[0].http.paths[0].pathType |
| 103 | + value: Prefix |
| 104 | + - equal: |
| 105 | + path: spec.rules[0].http.paths[0].backend.service.name |
| 106 | + value: stage |
| 107 | + - equal: |
| 108 | + path: spec.rules[0].http.paths[0].backend.service.port.number |
| 109 | + value: 3000 |
| 110 | + - equal: |
| 111 | + path: spec.rules[0].http.paths[1].path |
| 112 | + value: /api |
| 113 | + - equal: |
| 114 | + path: spec.rules[0].http.paths[1].pathType |
| 115 | + value: Prefix |
| 116 | + - equal: |
| 117 | + path: spec.rules[0].http.paths[1].backend.service.name |
| 118 | + value: conductor |
| 119 | + - equal: |
| 120 | + path: spec.rules[0].http.paths[1].backend.service.port.number |
| 121 | + value: 8080 |
| 122 | + |
| 123 | + - it: should create conductor configmap |
| 124 | + template: conductor-config-map.yaml |
| 125 | + asserts: |
| 126 | + - isKind: |
| 127 | + of: ConfigMap |
| 128 | + - equal: |
| 129 | + path: metadata.name |
| 130 | + value: debezium-platform-offsets |
| 131 | + |
| 132 | + - it: should create conductor service account |
| 133 | + template: conductor-service-account.yaml |
| 134 | + asserts: |
| 135 | + - isKind: |
| 136 | + of: ServiceAccount |
| 137 | + - equal: |
| 138 | + path: metadata.name |
| 139 | + value: conductor-service-account |
| 140 | + |
| 141 | + - it: should create conductor role with correct permissions |
| 142 | + template: conductor-role.yaml |
| 143 | + asserts: |
| 144 | + - isKind: |
| 145 | + of: Role |
| 146 | + - equal: |
| 147 | + path: metadata.name |
| 148 | + value: conductor-debeziumservers-creator |
| 149 | + - contains: |
| 150 | + path: rules |
| 151 | + content: |
| 152 | + apiGroups: ["debezium.io"] |
| 153 | + resources: ["debeziumservers"] |
| 154 | + verbs: ["patch", "create", "delete", "list", "deletecollection"] |
| 155 | + count: 1 |
| 156 | + - contains: |
| 157 | + path: rules |
| 158 | + content: |
| 159 | + apiGroups: ["apps"] |
| 160 | + resources: ["deployments", "replicasets"] |
| 161 | + verbs: ["get", "list"] |
| 162 | + count: 1 |
| 163 | + - contains: |
| 164 | + path: rules |
| 165 | + content: |
| 166 | + apiGroups: [""] |
| 167 | + resources: ["pods", "pods/log", "services"] |
| 168 | + verbs: ["get", "list"] |
| 169 | + count: 1 |
| 170 | + |
| 171 | + - it: should create conductor role binding |
| 172 | + template: conductor-role-binding.yaml |
| 173 | + asserts: |
| 174 | + - isKind: |
| 175 | + of: RoleBinding |
| 176 | + - equal: |
| 177 | + path: metadata.name |
| 178 | + value: conductor-role-binding |
0 commit comments