Skip to content

Commit

Permalink
chore: native client mock should be generated with go gen (#17864)
Browse files Browse the repository at this point in the history
* fix: native client mock should be generated with go gen

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix: native client mock should be generated with go gen

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* fix: native client mock should be generated with go gen

Signed-off-by: pashakostohrys <pavel@codefresh.io>

* adopt repository_test.go to new helm mock client

Signed-off-by: pashakostohrys <pavel@codefresh.io>

---------

Signed-off-by: pashakostohrys <pavel@codefresh.io>
  • Loading branch information
pasha-codefresh committed Apr 16, 2024
1 parent e12fae8 commit 48b636e
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 23 deletions.
4 changes: 2 additions & 2 deletions reposerver/repository/repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ func newServiceWithMocks(t *testing.T, root string, signed bool) (*Service, *git
chart: {{Version: "1.0.0"}, {Version: version}},
oobChart: {{Version: "1.0.0"}, {Version: version}},
}}, nil)
helmClient.On("ExtractChart", chart, version).Return("./testdata/my-chart", io.NopCloser, nil)
helmClient.On("ExtractChart", oobChart, version).Return("./testdata2/out-of-bounds-chart", io.NopCloser, nil)
helmClient.On("ExtractChart", chart, version, false, int64(0), false).Return("./testdata/my-chart", io.NopCloser, nil)
helmClient.On("ExtractChart", oobChart, version, false, int64(0), false).Return("./testdata2/out-of-bounds-chart", io.NopCloser, nil)
helmClient.On("CleanChartCache", chart, version).Return(nil)
helmClient.On("CleanChartCache", oobChart, version).Return(nil)
helmClient.On("DependencyBuild").Return(nil)
Expand Down
2 changes: 2 additions & 0 deletions util/helm/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import (
"github.com/argoproj/argo-cd/v2/util/proxy"
)

//go:generate go run github.com/vektra/mockery/v2@v2.25.1 --name=Client

var (
globalLock = sync.NewKeyLock()
indexLock = sync.NewKeyLock()
Expand Down
69 changes: 48 additions & 21 deletions util/helm/mocks/Client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 48b636e

Please sign in to comment.