Skip to content

Commit

Permalink
updates to unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Kimmel <[email protected]>
  • Loading branch information
joe-kimmel-vmw committed May 31, 2023
1 parent 92b3363 commit d8c6ca3
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions extender_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,16 +311,13 @@ func testExtender(t *testing.T, when spec.G, it spec.S) {
firstConfig := &v1.ConfigFile{Config: v1.Config{
User: "0:5678",
}}
someFakeImage.ConfigFileReturnsOnCall(0, firstConfig, nil)
someFakeImage.ConfigFileReturns(firstConfig, nil)
someFakeImage.ManifestReturns(&v1.Manifest{Layers: []v1.Descriptor{}}, nil)

fakeDockerfileApplier.EXPECT().Apply(
gomock.Any(),
someFakeImage,
extend.Options{
BuildContext: "some-app-dir",
IgnorePaths: []string{"some-app-dir", "some-layers-dir", "some-platform-dir"},
CacheTTL: 7 * (24 * time.Hour),
},
gomock.Any(),
gomock.Any(),
logger,
).DoAndReturn(
func(dockerfile extend.Dockerfile, toBaseImage v1.Image, withBuildOptions extend.Options, logger llog.Logger) (v1.Image, error) {
Expand All @@ -337,7 +334,6 @@ func testExtender(t *testing.T, when spec.G, it spec.S) {

return someFakeImage, nil
})
someFakeImage.ConfigFileReturnsOnCall(1, firstConfig, nil)

err := extender.Extend("build", logger)
h.AssertError(t, err, "extending build image: the final user ID is 0 (root); please add another extension that resets the user to non-root")
Expand Down

0 comments on commit d8c6ca3

Please sign in to comment.