detached c716365

#1 chore(deps): bump mockery to v3.9.0

state
merged · c716365 · fast-forward
branch
chore/bump-mockery-v3.9.0 → main
opened
bnema ·
updated

Bump the go:generate mockery pin from v3.6.0 to v3.9.0 and regenerate mocks (constructors now call t.Helper()).

5 files · +50 -14
2/2
M internal/ports/generate.go +1 -1
@@ -1,3 +1,3 @@
11 package ports
22
3-//go:generate go run github.com/vektra/mockery/v3@v3.6.0 --config=../../.mockery.yaml
3+//go:generate go run github.com/vektra/mockery/v3@v3.9.0 --config=../../.mockery.yaml
@@ -1,3 +1,3 @@
1 package ports1 package ports
2 2
3-//go:generate go run github.com/vektra/mockery/v3@v3.6.0 --config=../../.mockery.yaml3+//go:generate go run github.com/vektra/mockery/v3@v3.9.0 --config=../../.mockery.yaml
M internal/ports/mocks/AccountRepository.go +14 -5
@@ -17,10 +17,19 @@ func NewMockAccountRepository(t interface {
1717 mock.TestingT
1818 Cleanup(func())
1919 }) *MockAccountRepository {
20+ if helper, ok := t.(interface{ Helper() }); ok {
21+ helper.Helper()
22+ }
23+
2024 mock := &MockAccountRepository{}
2125 mock.Mock.Test(t)
2226
23- t.Cleanup(func() { mock.AssertExpectations(t) })
27+ t.Cleanup(func() {
28+ if helper, ok := t.(interface{ Helper() }); ok {
29+ helper.Helper()
30+ }
31+ mock.AssertExpectations(t)
32+ })
2433
2534 return mock
2635 }
@@ -63,7 +72,7 @@ type MockAccountRepository_Delete_Call struct {
6372 // Delete is a helper method to define mock.On call
6473 // - ctx context.Context
6574 // - id domain.AccountID
66-func (_e *MockAccountRepository_Expecter) Delete(ctx interface{}, id interface{}) *MockAccountRepository_Delete_Call {
75+func (_e *MockAccountRepository_Expecter) Delete(ctx any, id any) *MockAccountRepository_Delete_Call {
6776 return &MockAccountRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, id)}
6877 }
6978
@@ -129,7 +138,7 @@ type MockAccountRepository_GetByID_Call struct {
129138 // GetByID is a helper method to define mock.On call
130139 // - ctx context.Context
131140 // - id domain.AccountID
132-func (_e *MockAccountRepository_Expecter) GetByID(ctx interface{}, id interface{}) *MockAccountRepository_GetByID_Call {
141+func (_e *MockAccountRepository_Expecter) GetByID(ctx any, id any) *MockAccountRepository_GetByID_Call {
133142 return &MockAccountRepository_GetByID_Call{Call: _e.mock.On("GetByID", ctx, id)}
134143 }
135144
@@ -196,7 +205,7 @@ type MockAccountRepository_List_Call struct {
196205
197206 // List is a helper method to define mock.On call
198207 // - ctx context.Context
199-func (_e *MockAccountRepository_Expecter) List(ctx interface{}) *MockAccountRepository_List_Call {
208+func (_e *MockAccountRepository_Expecter) List(ctx any) *MockAccountRepository_List_Call {
200209 return &MockAccountRepository_List_Call{Call: _e.mock.On("List", ctx)}
201210 }
202211
@@ -248,7 +257,7 @@ type MockAccountRepository_Save_Call struct {
248257 // Save is a helper method to define mock.On call
249258 // - ctx context.Context
250259 // - account domain.Account
251-func (_e *MockAccountRepository_Expecter) Save(ctx interface{}, account interface{}) *MockAccountRepository_Save_Call {
260+func (_e *MockAccountRepository_Expecter) Save(ctx any, account any) *MockAccountRepository_Save_Call {
252261 return &MockAccountRepository_Save_Call{Call: _e.mock.On("Save", ctx, account)}
253262 }
254263
@@ -17,10 +17,19 @@ func NewMockAccountRepository(t interface {
17 mock.TestingT17 mock.TestingT
18 Cleanup(func())18 Cleanup(func())
19 }) *MockAccountRepository {19 }) *MockAccountRepository {
20+ if helper, ok := t.(interface{ Helper() }); ok {
21+ helper.Helper()
22+ }
23+
20 mock := &MockAccountRepository{}24 mock := &MockAccountRepository{}
21 mock.Mock.Test(t)25 mock.Mock.Test(t)
22 26
23- t.Cleanup(func() { mock.AssertExpectations(t) })27+ t.Cleanup(func() {
28+ if helper, ok := t.(interface{ Helper() }); ok {
29+ helper.Helper()
30+ }
31+ mock.AssertExpectations(t)
32+ })
24 33
25 return mock34 return mock
26 }35 }
@@ -63,7 +72,7 @@ type MockAccountRepository_Delete_Call struct {
63 // Delete is a helper method to define mock.On call72 // Delete is a helper method to define mock.On call
64 // - ctx context.Context73 // - ctx context.Context
65 // - id domain.AccountID74 // - id domain.AccountID
66-func (_e *MockAccountRepository_Expecter) Delete(ctx interface{}, id interface{}) *MockAccountRepository_Delete_Call {75+func (_e *MockAccountRepository_Expecter) Delete(ctx any, id any) *MockAccountRepository_Delete_Call {
67 return &MockAccountRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, id)}76 return &MockAccountRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, id)}
68 }77 }
69 78
@@ -129,7 +138,7 @@ type MockAccountRepository_GetByID_Call struct {
129 // GetByID is a helper method to define mock.On call138 // GetByID is a helper method to define mock.On call
130 // - ctx context.Context139 // - ctx context.Context
131 // - id domain.AccountID140 // - id domain.AccountID
132-func (_e *MockAccountRepository_Expecter) GetByID(ctx interface{}, id interface{}) *MockAccountRepository_GetByID_Call {141+func (_e *MockAccountRepository_Expecter) GetByID(ctx any, id any) *MockAccountRepository_GetByID_Call {
133 return &MockAccountRepository_GetByID_Call{Call: _e.mock.On("GetByID", ctx, id)}142 return &MockAccountRepository_GetByID_Call{Call: _e.mock.On("GetByID", ctx, id)}
134 }143 }
135 144
@@ -196,7 +205,7 @@ type MockAccountRepository_List_Call struct {
196 205
197 // List is a helper method to define mock.On call206 // List is a helper method to define mock.On call
198 // - ctx context.Context207 // - ctx context.Context
199-func (_e *MockAccountRepository_Expecter) List(ctx interface{}) *MockAccountRepository_List_Call {208+func (_e *MockAccountRepository_Expecter) List(ctx any) *MockAccountRepository_List_Call {
200 return &MockAccountRepository_List_Call{Call: _e.mock.On("List", ctx)}209 return &MockAccountRepository_List_Call{Call: _e.mock.On("List", ctx)}
201 }210 }
202 211
@@ -248,7 +257,7 @@ type MockAccountRepository_Save_Call struct {
248 // Save is a helper method to define mock.On call257 // Save is a helper method to define mock.On call
249 // - ctx context.Context258 // - ctx context.Context
250 // - account domain.Account259 // - account domain.Account
251-func (_e *MockAccountRepository_Expecter) Save(ctx interface{}, account interface{}) *MockAccountRepository_Save_Call {260+func (_e *MockAccountRepository_Expecter) Save(ctx any, account any) *MockAccountRepository_Save_Call {
252 return &MockAccountRepository_Save_Call{Call: _e.mock.On("Save", ctx, account)}261 return &MockAccountRepository_Save_Call{Call: _e.mock.On("Save", ctx, account)}
253 }262 }
254 263
M internal/ports/mocks/Clock.go +10 -1
@@ -16,10 +16,19 @@ func NewMockClock(t interface {
1616 mock.TestingT
1717 Cleanup(func())
1818 }) *MockClock {
19+ if helper, ok := t.(interface{ Helper() }); ok {
20+ helper.Helper()
21+ }
22+
1923 mock := &MockClock{}
2024 mock.Mock.Test(t)
2125
22- t.Cleanup(func() { mock.AssertExpectations(t) })
26+ t.Cleanup(func() {
27+ if helper, ok := t.(interface{ Helper() }); ok {
28+ helper.Helper()
29+ }
30+ mock.AssertExpectations(t)
31+ })
2332
2433 return mock
2534 }
@@ -16,10 +16,19 @@ func NewMockClock(t interface {
16 mock.TestingT16 mock.TestingT
17 Cleanup(func())17 Cleanup(func())
18 }) *MockClock {18 }) *MockClock {
19+ if helper, ok := t.(interface{ Helper() }); ok {
20+ helper.Helper()
21+ }
22+
19 mock := &MockClock{}23 mock := &MockClock{}
20 mock.Mock.Test(t)24 mock.Mock.Test(t)
21 25
22- t.Cleanup(func() { mock.AssertExpectations(t) })26+ t.Cleanup(func() {
27+ if helper, ok := t.(interface{ Helper() }); ok {
28+ helper.Helper()
29+ }
30+ mock.AssertExpectations(t)
31+ })
23 32
24 return mock33 return mock
25 }34 }
M internal/ports/mocks/SecretStore.go +13 -4
@@ -16,10 +16,19 @@ func NewMockSecretStore(t interface {
1616 mock.TestingT
1717 Cleanup(func())
1818 }) *MockSecretStore {
19+ if helper, ok := t.(interface{ Helper() }); ok {
20+ helper.Helper()
21+ }
22+
1923 mock := &MockSecretStore{}
2024 mock.Mock.Test(t)
2125
22- t.Cleanup(func() { mock.AssertExpectations(t) })
26+ t.Cleanup(func() {
27+ if helper, ok := t.(interface{ Helper() }); ok {
28+ helper.Helper()
29+ }
30+ mock.AssertExpectations(t)
31+ })
2332
2433 return mock
2534 }
@@ -62,7 +71,7 @@ type MockSecretStore_Delete_Call struct {
6271 // Delete is a helper method to define mock.On call
6372 // - ctx context.Context
6473 // - key string
65-func (_e *MockSecretStore_Expecter) Delete(ctx interface{}, key interface{}) *MockSecretStore_Delete_Call {
74+func (_e *MockSecretStore_Expecter) Delete(ctx any, key any) *MockSecretStore_Delete_Call {
6675 return &MockSecretStore_Delete_Call{Call: _e.mock.On("Delete", ctx, key)}
6776 }
6877
@@ -128,7 +137,7 @@ type MockSecretStore_Get_Call struct {
128137 // Get is a helper method to define mock.On call
129138 // - ctx context.Context
130139 // - key string
131-func (_e *MockSecretStore_Expecter) Get(ctx interface{}, key interface{}) *MockSecretStore_Get_Call {
140+func (_e *MockSecretStore_Expecter) Get(ctx any, key any) *MockSecretStore_Get_Call {
132141 return &MockSecretStore_Get_Call{Call: _e.mock.On("Get", ctx, key)}
133142 }
134143
@@ -186,7 +195,7 @@ type MockSecretStore_Put_Call struct {
186195 // - ctx context.Context
187196 // - key string
188197 // - value string
189-func (_e *MockSecretStore_Expecter) Put(ctx interface{}, key interface{}, value interface{}) *MockSecretStore_Put_Call {
198+func (_e *MockSecretStore_Expecter) Put(ctx any, key any, value any) *MockSecretStore_Put_Call {
190199 return &MockSecretStore_Put_Call{Call: _e.mock.On("Put", ctx, key, value)}
191200 }
192201
@@ -16,10 +16,19 @@ func NewMockSecretStore(t interface {
16 mock.TestingT16 mock.TestingT
17 Cleanup(func())17 Cleanup(func())
18 }) *MockSecretStore {18 }) *MockSecretStore {
19+ if helper, ok := t.(interface{ Helper() }); ok {
20+ helper.Helper()
21+ }
22+
19 mock := &MockSecretStore{}23 mock := &MockSecretStore{}
20 mock.Mock.Test(t)24 mock.Mock.Test(t)
21 25
22- t.Cleanup(func() { mock.AssertExpectations(t) })26+ t.Cleanup(func() {
27+ if helper, ok := t.(interface{ Helper() }); ok {
28+ helper.Helper()
29+ }
30+ mock.AssertExpectations(t)
31+ })
23 32
24 return mock33 return mock
25 }34 }
@@ -62,7 +71,7 @@ type MockSecretStore_Delete_Call struct {
62 // Delete is a helper method to define mock.On call71 // Delete is a helper method to define mock.On call
63 // - ctx context.Context72 // - ctx context.Context
64 // - key string73 // - key string
65-func (_e *MockSecretStore_Expecter) Delete(ctx interface{}, key interface{}) *MockSecretStore_Delete_Call {74+func (_e *MockSecretStore_Expecter) Delete(ctx any, key any) *MockSecretStore_Delete_Call {
66 return &MockSecretStore_Delete_Call{Call: _e.mock.On("Delete", ctx, key)}75 return &MockSecretStore_Delete_Call{Call: _e.mock.On("Delete", ctx, key)}
67 }76 }
68 77
@@ -128,7 +137,7 @@ type MockSecretStore_Get_Call struct {
128 // Get is a helper method to define mock.On call137 // Get is a helper method to define mock.On call
129 // - ctx context.Context138 // - ctx context.Context
130 // - key string139 // - key string
131-func (_e *MockSecretStore_Expecter) Get(ctx interface{}, key interface{}) *MockSecretStore_Get_Call {140+func (_e *MockSecretStore_Expecter) Get(ctx any, key any) *MockSecretStore_Get_Call {
132 return &MockSecretStore_Get_Call{Call: _e.mock.On("Get", ctx, key)}141 return &MockSecretStore_Get_Call{Call: _e.mock.On("Get", ctx, key)}
133 }142 }
134 143
@@ -186,7 +195,7 @@ type MockSecretStore_Put_Call struct {
186 // - ctx context.Context195 // - ctx context.Context
187 // - key string196 // - key string
188 // - value string197 // - value string
189-func (_e *MockSecretStore_Expecter) Put(ctx interface{}, key interface{}, value interface{}) *MockSecretStore_Put_Call {198+func (_e *MockSecretStore_Expecter) Put(ctx any, key any, value any) *MockSecretStore_Put_Call {
190 return &MockSecretStore_Put_Call{Call: _e.mock.On("Put", ctx, key, value)}199 return &MockSecretStore_Put_Call{Call: _e.mock.On("Put", ctx, key, value)}
191 }200 }
192 201
M internal/ports/mocks/SelectionHistory.go +12 -3
@@ -18,10 +18,19 @@ func NewMockSelectionHistory(t interface {
1818 mock.TestingT
1919 Cleanup(func())
2020 }) *MockSelectionHistory {
21+ if helper, ok := t.(interface{ Helper() }); ok {
22+ helper.Helper()
23+ }
24+
2125 mock := &MockSelectionHistory{}
2226 mock.Mock.Test(t)
2327
24- t.Cleanup(func() { mock.AssertExpectations(t) })
28+ t.Cleanup(func() {
29+ if helper, ok := t.(interface{ Helper() }); ok {
30+ helper.Helper()
31+ }
32+ mock.AssertExpectations(t)
33+ })
2534
2635 return mock
2736 }
@@ -75,7 +84,7 @@ type MockSelectionHistory_RecentSelections_Call struct {
7584 // RecentSelections is a helper method to define mock.On call
7685 // - ctx context.Context
7786 // - since time.Time
78-func (_e *MockSelectionHistory_Expecter) RecentSelections(ctx interface{}, since interface{}) *MockSelectionHistory_RecentSelections_Call {
87+func (_e *MockSelectionHistory_Expecter) RecentSelections(ctx any, since any) *MockSelectionHistory_RecentSelections_Call {
7988 return &MockSelectionHistory_RecentSelections_Call{Call: _e.mock.On("RecentSelections", ctx, since)}
8089 }
8190
@@ -133,7 +142,7 @@ type MockSelectionHistory_RecordSelection_Call struct {
133142 // - ctx context.Context
134143 // - id domain.AccountID
135144 // - selectedAt time.Time
136-func (_e *MockSelectionHistory_Expecter) RecordSelection(ctx interface{}, id interface{}, selectedAt interface{}) *MockSelectionHistory_RecordSelection_Call {
145+func (_e *MockSelectionHistory_Expecter) RecordSelection(ctx any, id any, selectedAt any) *MockSelectionHistory_RecordSelection_Call {
137146 return &MockSelectionHistory_RecordSelection_Call{Call: _e.mock.On("RecordSelection", ctx, id, selectedAt)}
138147 }
139148
@@ -18,10 +18,19 @@ func NewMockSelectionHistory(t interface {
18 mock.TestingT18 mock.TestingT
19 Cleanup(func())19 Cleanup(func())
20 }) *MockSelectionHistory {20 }) *MockSelectionHistory {
21+ if helper, ok := t.(interface{ Helper() }); ok {
22+ helper.Helper()
23+ }
24+
21 mock := &MockSelectionHistory{}25 mock := &MockSelectionHistory{}
22 mock.Mock.Test(t)26 mock.Mock.Test(t)
23 27
24- t.Cleanup(func() { mock.AssertExpectations(t) })28+ t.Cleanup(func() {
29+ if helper, ok := t.(interface{ Helper() }); ok {
30+ helper.Helper()
31+ }
32+ mock.AssertExpectations(t)
33+ })
25 34
26 return mock35 return mock
27 }36 }
@@ -75,7 +84,7 @@ type MockSelectionHistory_RecentSelections_Call struct {
75 // RecentSelections is a helper method to define mock.On call84 // RecentSelections is a helper method to define mock.On call
76 // - ctx context.Context85 // - ctx context.Context
77 // - since time.Time86 // - since time.Time
78-func (_e *MockSelectionHistory_Expecter) RecentSelections(ctx interface{}, since interface{}) *MockSelectionHistory_RecentSelections_Call {87+func (_e *MockSelectionHistory_Expecter) RecentSelections(ctx any, since any) *MockSelectionHistory_RecentSelections_Call {
79 return &MockSelectionHistory_RecentSelections_Call{Call: _e.mock.On("RecentSelections", ctx, since)}88 return &MockSelectionHistory_RecentSelections_Call{Call: _e.mock.On("RecentSelections", ctx, since)}
80 }89 }
81 90
@@ -133,7 +142,7 @@ type MockSelectionHistory_RecordSelection_Call struct {
133 // - ctx context.Context142 // - ctx context.Context
134 // - id domain.AccountID143 // - id domain.AccountID
135 // - selectedAt time.Time144 // - selectedAt time.Time
136-func (_e *MockSelectionHistory_Expecter) RecordSelection(ctx interface{}, id interface{}, selectedAt interface{}) *MockSelectionHistory_RecordSelection_Call {145+func (_e *MockSelectionHistory_Expecter) RecordSelection(ctx any, id any, selectedAt any) *MockSelectionHistory_RecordSelection_Call {
137 return &MockSelectionHistory_RecordSelection_Call{Call: _e.mock.On("RecordSelection", ctx, id, selectedAt)}146 return &MockSelectionHistory_RecordSelection_Call{Call: _e.mock.On("RecordSelection", ctx, id, selectedAt)}
138 }147 }
139 148

Comments00 unresolved

    no comments yet.

    Keyboard shortcuts

    Single-key shortcuts are on. ctrl k and esc work whatever this says.

    ctrl k :
    go to a section, branch, tag, file or repository
    ?
    this list
    j k
    move the row cursor down / up
    enter
    open the row under the cursor; on Files, a directory opens or closes in place
    ↑ ↓ ← → home end
    in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
    l h
    on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. On pages with a side panel: into the panel (on a merge request, its files) / back to the content; there j k move between its controls
    g g G
    first / last row
    /
    filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
    b
    switch branch or tag
    g s g f g c g b g m g i g r g a
    tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
    g h
    home
    w
    wide mode: use the whole width of the screen, or not (remembered)
    y
    copy a permalink pinned to the commit; in a file, click a line number to select it, shift-click for a range
    d u x
    diff: split / unified / collapse or expand all
    e E
    diff: the whole file in view / every file, with the lines the hunks hide
    n
    merge request: next note in the diff
    l
    merge request: the list of files (j k move, enter opens, esc back)
    M
    merge request: the merge menu; there 1–3 pick the mode, D deletes the branch, enter merges
    R
    merge request: mark the head read
    esc
    close a dialog, leave a field

    Branches 2

    Tags 17

    ↑↓ moveenter openesc close