Migrate to mockery v3 (#5547)

This commit is contained in:
Robert Kaussow
2025-09-24 13:12:55 +02:00
committed by GitHub
parent 177de5d8d2
commit 2f3c4a28c1
58 changed files with 17705 additions and 7325 deletions

View File

@@ -65,7 +65,7 @@ func TestPipelineList(t *testing.T) {
for _, tt := range testtases {
t.Run(tt.name, func(t *testing.T) {
mockClient := mocks.NewClient(t)
mockClient := mocks.NewMockClient(t)
mockClient.On("PipelineList", mock.Anything, mock.Anything).Return(func(_ int64, opt woodpecker.PipelineListOptions) ([]*woodpecker.Pipeline, error) {
if tt.pipelineErr != nil {
return nil, tt.pipelineErr

View File

@@ -76,7 +76,7 @@ func TestPipelinePurge(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mockClient := mocks.NewClient(t)
mockClient := mocks.NewMockClient(t)
mockClient.On("RepoLookup", mock.Anything).Maybe().Return(&woodpecker.Repo{ID: tt.repoID}, nil)
mockClient.On("PipelineList", mock.Anything, mock.Anything).Return(func(_ int64, opt woodpecker.PipelineListOptions) ([]*woodpecker.Pipeline, error) {

View File

@@ -48,7 +48,7 @@ func TestRepoShow(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mockClient := mocks.NewClient(t)
mockClient := mocks.NewMockClient(t)
mockClient.On("Repo", tt.repoID).Return(tt.mockRepo, tt.mockError).Maybe()
mockClient.On("RepoLookup", "owner/repo").Return(tt.mockRepo, nil).Maybe()