1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8 "context"
9
10 "bnema.dev/ermite/internal/domain"
11 mock "github.com/stretchr/testify/mock"
12)
13
14// NewCIRunCleaner creates a new instance of CIRunCleaner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
15// The first argument is typically a *testing.T value.
16func NewCIRunCleaner(t interface {
17 mock.TestingT
18 Cleanup(func())
19}) *CIRunCleaner {
20 if helper, ok := t.(interface{ Helper() }); ok {
21 helper.Helper()
22 }
23
24 mock := &CIRunCleaner{}
25 mock.Mock.Test(t)
26
27 t.Cleanup(func() {
28 if helper, ok := t.(interface{ Helper() }); ok {
29 helper.Helper()
30 }
31 mock.AssertExpectations(t)
32 })
33
34 return mock
35}
36
37// CIRunCleaner is an autogenerated mock type for the CIRunCleaner type
38type CIRunCleaner struct {
39 mock.Mock
40}
41
42type CIRunCleaner_Expecter struct {
43 mock *mock.Mock
44}
45
46func (_m *CIRunCleaner) EXPECT() *CIRunCleaner_Expecter {
47 return &CIRunCleaner_Expecter{mock: &_m.Mock}
48}
49
50// ForgetRepo provides a mock function for the type CIRunCleaner
51func (_mock *CIRunCleaner) ForgetRepo(repo domain.RepoName) {
52 _mock.Called(repo)
53 return
54}
55
56// CIRunCleaner_ForgetRepo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForgetRepo'
57type CIRunCleaner_ForgetRepo_Call struct {
58 *mock.Call
59}
60
61// ForgetRepo is a helper method to define mock.On call
62// - repo domain.RepoName
63func (_e *CIRunCleaner_Expecter) ForgetRepo(repo any) *CIRunCleaner_ForgetRepo_Call {
64 return &CIRunCleaner_ForgetRepo_Call{Call: _e.mock.On("ForgetRepo", repo)}
65}
66
67func (_c *CIRunCleaner_ForgetRepo_Call) Run(run func(repo domain.RepoName)) *CIRunCleaner_ForgetRepo_Call {
68 _c.Call.Run(func(args mock.Arguments) {
69 var arg0 domain.RepoName
70 if args[0] != nil {
71 arg0 = args[0].(domain.RepoName)
72 }
73 run(
74 arg0,
75 )
76 })
77 return _c
78}
79
80func (_c *CIRunCleaner_ForgetRepo_Call) Return() *CIRunCleaner_ForgetRepo_Call {
81 _c.Call.Return()
82 return _c
83}
84
85func (_c *CIRunCleaner_ForgetRepo_Call) RunAndReturn(run func(repo domain.RepoName)) *CIRunCleaner_ForgetRepo_Call {
86 _c.Run(run)
87 return _c
88}
89
90// RemoveLogs provides a mock function for the type CIRunCleaner
91func (_mock *CIRunCleaner) RemoveLogs(ctx context.Context, runIDs []int64) error {
92 ret := _mock.Called(ctx, runIDs)
93
94 if len(ret) == 0 {
95 panic("no return value specified for RemoveLogs")
96 }
97
98 var r0 error
99 if returnFunc, ok := ret.Get(0).(func(context.Context, []int64) error); ok {
100 r0 = returnFunc(ctx, runIDs)
101 } else {
102 r0 = ret.Error(0)
103 }
104 return r0
105}
106
107// CIRunCleaner_RemoveLogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveLogs'
108type CIRunCleaner_RemoveLogs_Call struct {
109 *mock.Call
110}
111
112// RemoveLogs is a helper method to define mock.On call
113// - ctx context.Context
114// - runIDs []int64
115func (_e *CIRunCleaner_Expecter) RemoveLogs(ctx any, runIDs any) *CIRunCleaner_RemoveLogs_Call {
116 return &CIRunCleaner_RemoveLogs_Call{Call: _e.mock.On("RemoveLogs", ctx, runIDs)}
117}
118
119func (_c *CIRunCleaner_RemoveLogs_Call) Run(run func(ctx context.Context, runIDs []int64)) *CIRunCleaner_RemoveLogs_Call {
120 _c.Call.Run(func(args mock.Arguments) {
121 var arg0 context.Context
122 if args[0] != nil {
123 arg0 = args[0].(context.Context)
124 }
125 var arg1 []int64
126 if args[1] != nil {
127 arg1 = args[1].([]int64)
128 }
129 run(
130 arg0,
131 arg1,
132 )
133 })
134 return _c
135}
136
137func (_c *CIRunCleaner_RemoveLogs_Call) Return(err error) *CIRunCleaner_RemoveLogs_Call {
138 _c.Call.Return(err)
139 return _c
140}
141
142func (_c *CIRunCleaner_RemoveLogs_Call) RunAndReturn(run func(ctx context.Context, runIDs []int64) error) *CIRunCleaner_RemoveLogs_Call {
143 _c.Call.Return(run)
144 return _c
145}
146
147// RunIDs provides a mock function for the type CIRunCleaner
148func (_mock *CIRunCleaner) RunIDs(ctx context.Context, repo domain.RepoName) ([]int64, error) {
149 ret := _mock.Called(ctx, repo)
150
151 if len(ret) == 0 {
152 panic("no return value specified for RunIDs")
153 }
154
155 var r0 []int64
156 var r1 error
157 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName) ([]int64, error)); ok {
158 return returnFunc(ctx, repo)
159 }
160 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName) []int64); ok {
161 r0 = returnFunc(ctx, repo)
162 } else {
163 if ret.Get(0) != nil {
164 r0 = ret.Get(0).([]int64)
165 }
166 }
167 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName) error); ok {
168 r1 = returnFunc(ctx, repo)
169 } else {
170 r1 = ret.Error(1)
171 }
172 return r0, r1
173}
174
175// CIRunCleaner_RunIDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RunIDs'
176type CIRunCleaner_RunIDs_Call struct {
177 *mock.Call
178}
179
180// RunIDs is a helper method to define mock.On call
181// - ctx context.Context
182// - repo domain.RepoName
183func (_e *CIRunCleaner_Expecter) RunIDs(ctx any, repo any) *CIRunCleaner_RunIDs_Call {
184 return &CIRunCleaner_RunIDs_Call{Call: _e.mock.On("RunIDs", ctx, repo)}
185}
186
187func (_c *CIRunCleaner_RunIDs_Call) Run(run func(ctx context.Context, repo domain.RepoName)) *CIRunCleaner_RunIDs_Call {
188 _c.Call.Run(func(args mock.Arguments) {
189 var arg0 context.Context
190 if args[0] != nil {
191 arg0 = args[0].(context.Context)
192 }
193 var arg1 domain.RepoName
194 if args[1] != nil {
195 arg1 = args[1].(domain.RepoName)
196 }
197 run(
198 arg0,
199 arg1,
200 )
201 })
202 return _c
203}
204
205func (_c *CIRunCleaner_RunIDs_Call) Return(int64s []int64, err error) *CIRunCleaner_RunIDs_Call {
206 _c.Call.Return(int64s, err)
207 return _c
208}
209
210func (_c *CIRunCleaner_RunIDs_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName) ([]int64, error)) *CIRunCleaner_RunIDs_Call {
211 _c.Call.Return(run)
212 return _c
213}