MCPcopy
hub / github.com/docker/compose / Test_addBuildDependencies

Function Test_addBuildDependencies

pkg/compose/build_test.go:79–109  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

77}
78
79func Test_addBuildDependencies(t *testing.T) {
80 project := &types.Project{Services: types.Services{
81 "test": types.ServiceConfig{
82 Build: &types.BuildConfig{
83 AdditionalContexts: map[string]string{
84 "foo": "service:foo",
85 "bar": "service:bar",
86 },
87 },
88 },
89 "foo": types.ServiceConfig{
90 Build: &types.BuildConfig{
91 AdditionalContexts: map[string]string{
92 "zot": "service:zot",
93 },
94 },
95 },
96 "bar": types.ServiceConfig{
97 Build: &types.BuildConfig{},
98 },
99 "zot": types.ServiceConfig{
100 Build: &types.BuildConfig{},
101 },
102 }}
103
104 services := addBuildDependencies([]string{"test"}, project)
105 expected := []string{"test", "foo", "bar", "zot"}
106 slices.Sort(services)
107 slices.Sort(expected)
108 assert.DeepEqual(t, services, expected)
109}

Callers

nothing calls this directly

Calls 1

addBuildDependenciesFunction · 0.85

Tested by

no test coverage detected