MCPcopy Create free account
hub / github.com/compose-spec/compose-go / TestNormalizeImplicitDependencies

Function TestNormalizeImplicitDependencies

loader/normalize_test.go:175–241  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

173}
174
175func TestNormalizeImplicitDependencies(t *testing.T) {
176 project := `
177name: myProject
178services:
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 := `
192name: myProject
193services:
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
226networks:
227 default:
228 name: myProject_default
229`
230
231 var model map[string]any
232 err := yaml.Unmarshal([]byte(project), &model)

Callers

nothing calls this directly

Calls 1

NormalizeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…