Skip to content

Commit c560e9f

Browse files
fix tests
Signed-off-by: Darshan Kumar <[email protected]>
1 parent bb255dc commit c560e9f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

internal/build/extend_build_test.go

+10
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"github.com/apex/log"
1414
"github.com/buildpacks/lifecycle/buildpack"
1515
"github.com/docker/docker/api/types"
16+
"github.com/docker/docker/api/types/container"
1617
"github.com/golang/mock/gomock"
1718
"github.com/heroku/color"
1819
"github.com/sclevine/spec"
@@ -102,6 +103,11 @@ func testBuildDockerfiles(t *testing.T, when spec.G, it spec.S) {
102103
mockDockerClient.EXPECT().ImageBuild(gomock.Any(), gomock.Any(), gomock.Any()).Do(func(_ context.Context, buildContext io.Reader, buildOptions types.ImageBuildOptions) {
103104
compBuildOptions(t, expectedBuildOptions, buildOptions)
104105
}).Return(mockResponse, nil).Times(1)
106+
mockDockerClient.EXPECT().ImageInspectWithRaw(gomock.Any(), gomock.Any()).Return(types.ImageInspect{
107+
Config: &container.Config{
108+
User: "root",
109+
},
110+
}, nil, nil).Times(1)
105111
err := lifecycle.ExtendBuildByDaemon(context.Background())
106112
h.AssertNil(t, err)
107113
})
@@ -115,6 +121,10 @@ func testBuildDockerfiles(t *testing.T, when spec.G, it spec.S) {
115121
OSType: "linux",
116122
}
117123
mockDockerClient.EXPECT().ImageBuild(gomock.Any(), gomock.Any(), gomock.Any()).Return(mockResponse, nil).Times(2)
124+
mockDockerClient.EXPECT().ImageInspectWithRaw(gomock.Any(), gomock.Any()).Return(types.ImageInspect{
125+
Config: &container.Config{
126+
User: "root",
127+
}}, nil, nil).Times(2)
118128
err := lifecycle.ExtendBuildByDaemon(context.Background())
119129
h.AssertNil(t, err)
120130
})

0 commit comments

Comments
 (0)