MCPcopy Index your code
hub / github.com/docker/compose / TestApplyPlatforms_UnsupportedPlatform

Function TestApplyPlatforms_UnsupportedPlatform

cmd/compose/options_test.go:105–138  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

103}
104
105func TestApplyPlatforms_UnsupportedPlatform(t *testing.T) {
106 makeProject := func() *types.Project {
107 return &types.Project{
108 Environment: map[string]string{
109 "DOCKER_DEFAULT_PLATFORM": "commodore/64",
110 },
111 Services: types.Services{
112 "test": {
113 Name: "test",
114 Image: "foo",
115 Build: &types.BuildConfig{
116 Context: ".",
117 Platforms: []string{
118 "linux/amd64",
119 "linux/arm64",
120 },
121 },
122 },
123 },
124 }
125 }
126
127 t.Run("SinglePlatform", func(t *testing.T) {
128 project := makeProject()
129 assert.Error(t, applyPlatforms(project, true),
130 `service "test" build.platforms does not support value set by DOCKER_DEFAULT_PLATFORM: commodore/64`)
131 })
132
133 t.Run("MultiPlatform", func(t *testing.T) {
134 project := makeProject()
135 assert.Error(t, applyPlatforms(project, false),
136 `service "test" build.platforms does not support value set by DOCKER_DEFAULT_PLATFORM: commodore/64`)
137 })
138}
139
140func TestIsRemoteConfig(t *testing.T) {
141 ctrl := gomock.NewController(t)

Callers

nothing calls this directly

Calls 2

applyPlatformsFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…