(t *testing.T)
| 103 | } |
| 104 | |
| 105 | func 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 | |
| 140 | func TestIsRemoteConfig(t *testing.T) { |
| 141 | ctrl := gomock.NewController(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…