(t *testing.T)
| 77 | } |
| 78 | |
| 79 | func 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 | } |
nothing calls this directly
no test coverage detected