1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-04 08:55:55 +00:00

[v0.3] Migrate the mocking library to uber's (#475)

* Migrate the mocking library to uber's (#291)

* Migrate from golang/mock to uber/mock.

* Update go.mod

* Continue migration to uber/mock.

* Tweaks from running the go.uber.mock's mockgen.

* go generate ./...

---------

Co-authored-by: Eric Promislow <epromislow@suse.com>
This commit is contained in:
Tom Lebreux
2025-02-03 15:16:36 -05:00
committed by GitHub
parent 458a12d2d7
commit d50101289f
22 changed files with 181 additions and 132 deletions

View File

@@ -1,5 +1,10 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/rancher/steve/pkg/stores/sqlproxy (interfaces: Cache,ClientGetter,CacheFactory,SchemaColumnSetter,RelationshipNotifier,TransformBuilder)
//
// Generated by this command:
//
// mockgen --build_flags=--mod=mod -package sqlproxy -destination ./proxy_mocks_test.go github.com/rancher/steve/pkg/stores/sqlproxy Cache,ClientGetter,CacheFactory,SchemaColumnSetter,RelationshipNotifier,TransformBuilder
//
// Package sqlproxy is a generated GoMock package.
package sqlproxy
@@ -8,12 +13,12 @@ import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
types "github.com/rancher/apiserver/pkg/types"
informer "github.com/rancher/lasso/pkg/cache/sql/informer"
factory "github.com/rancher/lasso/pkg/cache/sql/informer/factory"
partition "github.com/rancher/lasso/pkg/cache/sql/partition"
summary "github.com/rancher/wrangler/v3/pkg/summary"
gomock "go.uber.org/mock/gomock"
unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
schema "k8s.io/apimachinery/pkg/runtime/schema"
dynamic "k8s.io/client-go/dynamic"
@@ -57,7 +62,7 @@ func (m *MockCache) ListByOptions(arg0 context.Context, arg1 informer.ListOption
}
// ListByOptions indicates an expected call of ListByOptions.
func (mr *MockCacheMockRecorder) ListByOptions(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
func (mr *MockCacheMockRecorder) ListByOptions(arg0, arg1, arg2, arg3 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListByOptions", reflect.TypeOf((*MockCache)(nil).ListByOptions), arg0, arg1, arg2, arg3)
}
@@ -95,7 +100,7 @@ func (m *MockClientGetter) AdminClient(arg0 *types.APIRequest, arg1 *types.APISc
}
// AdminClient indicates an expected call of AdminClient.
func (mr *MockClientGetterMockRecorder) AdminClient(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
func (mr *MockClientGetterMockRecorder) AdminClient(arg0, arg1, arg2, arg3 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AdminClient", reflect.TypeOf((*MockClientGetter)(nil).AdminClient), arg0, arg1, arg2, arg3)
}
@@ -125,7 +130,7 @@ func (m *MockClientGetter) Client(arg0 *types.APIRequest, arg1 *types.APISchema,
}
// Client indicates an expected call of Client.
func (mr *MockClientGetterMockRecorder) Client(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
func (mr *MockClientGetterMockRecorder) Client(arg0, arg1, arg2, arg3 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Client", reflect.TypeOf((*MockClientGetter)(nil).Client), arg0, arg1, arg2, arg3)
}
@@ -140,7 +145,7 @@ func (m *MockClientGetter) DynamicClient(arg0 *types.APIRequest, arg1 rest.Warni
}
// DynamicClient indicates an expected call of DynamicClient.
func (mr *MockClientGetterMockRecorder) DynamicClient(arg0, arg1 interface{}) *gomock.Call {
func (mr *MockClientGetterMockRecorder) DynamicClient(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DynamicClient", reflect.TypeOf((*MockClientGetter)(nil).DynamicClient), arg0, arg1)
}
@@ -169,7 +174,7 @@ func (m *MockClientGetter) K8sInterface(arg0 *types.APIRequest) (kubernetes.Inte
}
// K8sInterface indicates an expected call of K8sInterface.
func (mr *MockClientGetterMockRecorder) K8sInterface(arg0 interface{}) *gomock.Call {
func (mr *MockClientGetterMockRecorder) K8sInterface(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "K8sInterface", reflect.TypeOf((*MockClientGetter)(nil).K8sInterface), arg0)
}
@@ -184,7 +189,7 @@ func (m *MockClientGetter) TableAdminClient(arg0 *types.APIRequest, arg1 *types.
}
// TableAdminClient indicates an expected call of TableAdminClient.
func (mr *MockClientGetterMockRecorder) TableAdminClient(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
func (mr *MockClientGetterMockRecorder) TableAdminClient(arg0, arg1, arg2, arg3 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TableAdminClient", reflect.TypeOf((*MockClientGetter)(nil).TableAdminClient), arg0, arg1, arg2, arg3)
}
@@ -199,7 +204,7 @@ func (m *MockClientGetter) TableAdminClientForWatch(arg0 *types.APIRequest, arg1
}
// TableAdminClientForWatch indicates an expected call of TableAdminClientForWatch.
func (mr *MockClientGetterMockRecorder) TableAdminClientForWatch(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
func (mr *MockClientGetterMockRecorder) TableAdminClientForWatch(arg0, arg1, arg2, arg3 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TableAdminClientForWatch", reflect.TypeOf((*MockClientGetter)(nil).TableAdminClientForWatch), arg0, arg1, arg2, arg3)
}
@@ -214,7 +219,7 @@ func (m *MockClientGetter) TableClient(arg0 *types.APIRequest, arg1 *types.APISc
}
// TableClient indicates an expected call of TableClient.
func (mr *MockClientGetterMockRecorder) TableClient(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
func (mr *MockClientGetterMockRecorder) TableClient(arg0, arg1, arg2, arg3 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TableClient", reflect.TypeOf((*MockClientGetter)(nil).TableClient), arg0, arg1, arg2, arg3)
}
@@ -229,7 +234,7 @@ func (m *MockClientGetter) TableClientForWatch(arg0 *types.APIRequest, arg1 *typ
}
// TableClientForWatch indicates an expected call of TableClientForWatch.
func (mr *MockClientGetterMockRecorder) TableClientForWatch(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
func (mr *MockClientGetterMockRecorder) TableClientForWatch(arg0, arg1, arg2, arg3 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TableClientForWatch", reflect.TypeOf((*MockClientGetter)(nil).TableClientForWatch), arg0, arg1, arg2, arg3)
}
@@ -267,7 +272,7 @@ func (m *MockCacheFactory) CacheFor(arg0 [][]string, arg1 cache.TransformFunc, a
}
// CacheFor indicates an expected call of CacheFor.
func (mr *MockCacheFactoryMockRecorder) CacheFor(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call {
func (mr *MockCacheFactoryMockRecorder) CacheFor(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CacheFor", reflect.TypeOf((*MockCacheFactory)(nil).CacheFor), arg0, arg1, arg2, arg3, arg4, arg5)
}
@@ -318,7 +323,7 @@ func (m *MockSchemaColumnSetter) SetColumns(arg0 context.Context, arg1 *types.AP
}
// SetColumns indicates an expected call of SetColumns.
func (mr *MockSchemaColumnSetterMockRecorder) SetColumns(arg0, arg1 interface{}) *gomock.Call {
func (mr *MockSchemaColumnSetterMockRecorder) SetColumns(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetColumns", reflect.TypeOf((*MockSchemaColumnSetter)(nil).SetColumns), arg0, arg1)
}
@@ -355,7 +360,7 @@ func (m *MockRelationshipNotifier) OnInboundRelationshipChange(arg0 context.Cont
}
// OnInboundRelationshipChange indicates an expected call of OnInboundRelationshipChange.
func (mr *MockRelationshipNotifierMockRecorder) OnInboundRelationshipChange(arg0, arg1, arg2 interface{}) *gomock.Call {
func (mr *MockRelationshipNotifierMockRecorder) OnInboundRelationshipChange(arg0, arg1, arg2 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnInboundRelationshipChange", reflect.TypeOf((*MockRelationshipNotifier)(nil).OnInboundRelationshipChange), arg0, arg1, arg2)
}
@@ -392,7 +397,7 @@ func (m *MockTransformBuilder) GetTransformFunc(arg0 schema.GroupVersionKind) ca
}
// GetTransformFunc indicates an expected call of GetTransformFunc.
func (mr *MockTransformBuilderMockRecorder) GetTransformFunc(arg0 interface{}) *gomock.Call {
func (mr *MockTransformBuilderMockRecorder) GetTransformFunc(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTransformFunc", reflect.TypeOf((*MockTransformBuilder)(nil).GetTransformFunc), arg0)
}