(t *testing.T)
| 173 | } |
| 174 | |
| 175 | func TestNormalizeImplicitDependencies(t *testing.T) { |
| 176 | project := ` |
| 177 | name: myProject |
| 178 | services: |
| 179 | test: |
| 180 | ipc: service:foo |
| 181 | cgroup: service:bar |
| 182 | uts: service:baz |
| 183 | pid: service:qux |
| 184 | volumes_from: [quux] |
| 185 | links: [corge] |
| 186 | depends_on: # explicit dependency MUST not be overridden |
| 187 | foo: |
| 188 | condition: service_healthy |
| 189 | ` |
| 190 | |
| 191 | expected := ` |
| 192 | name: myProject |
| 193 | services: |
| 194 | test: |
| 195 | ipc: service:foo |
| 196 | cgroup: service:bar |
| 197 | uts: service:baz |
| 198 | pid: service:qux |
| 199 | volumes_from: [quux] |
| 200 | links: [corge] |
| 201 | depends_on: # explicit dependency MUST not be overridden |
| 202 | foo: |
| 203 | condition: service_healthy |
| 204 | bar: |
| 205 | condition: service_started |
| 206 | restart: true |
| 207 | required: true |
| 208 | baz: |
| 209 | condition: service_started |
| 210 | restart: true |
| 211 | required: true |
| 212 | qux: |
| 213 | condition: service_started |
| 214 | restart: true |
| 215 | required: true |
| 216 | quux: |
| 217 | condition: service_started |
| 218 | required: true |
| 219 | restart: false |
| 220 | corge: |
| 221 | condition: service_started |
| 222 | restart: true |
| 223 | required: true |
| 224 | networks: |
| 225 | default: null |
| 226 | networks: |
| 227 | default: |
| 228 | name: myProject_default |
| 229 | ` |
| 230 | |
| 231 | var model map[string]any |
| 232 | err := yaml.Unmarshal([]byte(project), &model) |
nothing calls this directly
no test coverage detected
searching dependent graphs…