Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Darshan Kumar <[email protected]>
  • Loading branch information
itsdarshankumar committed Dec 26, 2023
1 parent bb255dc commit c560e9f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/build/extend_build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/apex/log"
"github.com/buildpacks/lifecycle/buildpack"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/golang/mock/gomock"
"github.com/heroku/color"
"github.com/sclevine/spec"
Expand Down Expand Up @@ -102,6 +103,11 @@ func testBuildDockerfiles(t *testing.T, when spec.G, it spec.S) {
mockDockerClient.EXPECT().ImageBuild(gomock.Any(), gomock.Any(), gomock.Any()).Do(func(_ context.Context, buildContext io.Reader, buildOptions types.ImageBuildOptions) {
compBuildOptions(t, expectedBuildOptions, buildOptions)
}).Return(mockResponse, nil).Times(1)
mockDockerClient.EXPECT().ImageInspectWithRaw(gomock.Any(), gomock.Any()).Return(types.ImageInspect{
Config: &container.Config{
User: "root",
},
}, nil, nil).Times(1)
err := lifecycle.ExtendBuildByDaemon(context.Background())
h.AssertNil(t, err)
})
Expand All @@ -115,6 +121,10 @@ func testBuildDockerfiles(t *testing.T, when spec.G, it spec.S) {
OSType: "linux",
}
mockDockerClient.EXPECT().ImageBuild(gomock.Any(), gomock.Any(), gomock.Any()).Return(mockResponse, nil).Times(2)
mockDockerClient.EXPECT().ImageInspectWithRaw(gomock.Any(), gomock.Any()).Return(types.ImageInspect{
Config: &container.Config{
User: "root",
}}, nil, nil).Times(2)
err := lifecycle.ExtendBuildByDaemon(context.Background())
h.AssertNil(t, err)
})
Expand Down

0 comments on commit c560e9f

Please sign in to comment.