From dce29fa9b272cd79324cdf5621d7dea2f71a498d Mon Sep 17 00:00:00 2001 From: Congqi Xia Date: Wed, 20 Mar 2024 21:15:51 +0800 Subject: [PATCH 1/2] enhance: Bump milvus-proto/go-api to v2.4.0-rc.1 Sync proto version to v2.4.0-rc.1 to support new features Signed-off-by: Congqi Xia --- client/client_mock_test.go | 4 +++ go.mod | 2 +- go.sum | 4 +-- mocks/MilvusServiceServer.go | 55 ++++++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 3 deletions(-) diff --git a/client/client_mock_test.go b/client/client_mock_test.go index 45cd851c..33f72f7a 100644 --- a/client/client_mock_test.go +++ b/client/client_mock_test.go @@ -1026,3 +1026,7 @@ func (m *MockServer) HybridSearch(ctx context.Context, req *milvuspb.HybridSearc status, err := SuccessStatus() return &milvuspb.SearchResults{Status: status}, err } + +func (m *MockServer) UpdateResourceGroups(ctx context.Context, req *milvuspb.UpdateResourceGroupsRequest) (*commonpb.Status, error) { + return nil, errors.New("not implemented") +} diff --git a/go.mod b/go.mod index b0ee74e3..713a20b9 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/go-faker/faker/v4 v4.1.0 github.com/golang/protobuf v1.5.2 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 - github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20240109020841-d367b5a59df1 + github.com/milvus-io/milvus-proto/go-api/v2 v2.4.0-rc.1 github.com/stretchr/testify v1.8.1 github.com/tidwall/gjson v1.14.4 google.golang.org/grpc v1.48.0 diff --git a/go.sum b/go.sum index a2c251a7..3fe2e556 100644 --- a/go.sum +++ b/go.sum @@ -157,8 +157,8 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= -github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20240109020841-d367b5a59df1 h1:oNpMivd94JAMhdSVsFw8t1b+olXz8pbzd5PES21sth8= -github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20240109020841-d367b5a59df1/go.mod h1:1OIl0v5PQeNxIJhCvY+K55CBUOYDZevw9g9380u1Wek= +github.com/milvus-io/milvus-proto/go-api/v2 v2.4.0-rc.1 h1:9g5pVbPiCuFBJbTKxMo3vq4N9/XdCbh8R06DKDF/V+g= +github.com/milvus-io/milvus-proto/go-api/v2 v2.4.0-rc.1/go.mod h1:1OIl0v5PQeNxIJhCvY+K55CBUOYDZevw9g9380u1Wek= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= diff --git a/mocks/MilvusServiceServer.go b/mocks/MilvusServiceServer.go index fb41abba..3ca7c40c 100644 --- a/mocks/MilvusServiceServer.go +++ b/mocks/MilvusServiceServer.go @@ -4537,6 +4537,61 @@ func (_c *MilvusServiceServer_UpdateCredential_Call) RunAndReturn(run func(conte return _c } +// UpdateResourceGroups provides a mock function with given fields: _a0, _a1 +func (_m *MilvusServiceServer) UpdateResourceGroups(_a0 context.Context, _a1 *milvuspb.UpdateResourceGroupsRequest) (*commonpb.Status, error) { + ret := _m.Called(_a0, _a1) + + var r0 *commonpb.Status + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.UpdateResourceGroupsRequest) (*commonpb.Status, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *milvuspb.UpdateResourceGroupsRequest) *commonpb.Status); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*commonpb.Status) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *milvuspb.UpdateResourceGroupsRequest) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MilvusServiceServer_UpdateResourceGroups_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateResourceGroups' +type MilvusServiceServer_UpdateResourceGroups_Call struct { + *mock.Call +} + +// UpdateResourceGroups is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *milvuspb.UpdateResourceGroupsRequest +func (_e *MilvusServiceServer_Expecter) UpdateResourceGroups(_a0 interface{}, _a1 interface{}) *MilvusServiceServer_UpdateResourceGroups_Call { + return &MilvusServiceServer_UpdateResourceGroups_Call{Call: _e.mock.On("UpdateResourceGroups", _a0, _a1)} +} + +func (_c *MilvusServiceServer_UpdateResourceGroups_Call) Run(run func(_a0 context.Context, _a1 *milvuspb.UpdateResourceGroupsRequest)) *MilvusServiceServer_UpdateResourceGroups_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*milvuspb.UpdateResourceGroupsRequest)) + }) + return _c +} + +func (_c *MilvusServiceServer_UpdateResourceGroups_Call) Return(_a0 *commonpb.Status, _a1 error) *MilvusServiceServer_UpdateResourceGroups_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MilvusServiceServer_UpdateResourceGroups_Call) RunAndReturn(run func(context.Context, *milvuspb.UpdateResourceGroupsRequest) (*commonpb.Status, error)) *MilvusServiceServer_UpdateResourceGroups_Call { + _c.Call.Return(run) + return _c +} + // Upsert provides a mock function with given fields: _a0, _a1 func (_m *MilvusServiceServer) Upsert(_a0 context.Context, _a1 *milvuspb.UpsertRequest) (*milvuspb.MutationResult, error) { ret := _m.Called(_a0, _a1) From 64a2d3384774203de81c486abba664e771d4e305 Mon Sep 17 00:00:00 2001 From: Congqi Xia Date: Wed, 20 Mar 2024 21:19:18 +0800 Subject: [PATCH 2/2] Fix unused lint Signed-off-by: Congqi Xia --- client/client_mock_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/client_mock_test.go b/client/client_mock_test.go index 33f72f7a..1f0c3ca7 100644 --- a/client/client_mock_test.go +++ b/client/client_mock_test.go @@ -1027,6 +1027,6 @@ func (m *MockServer) HybridSearch(ctx context.Context, req *milvuspb.HybridSearc return &milvuspb.SearchResults{Status: status}, err } -func (m *MockServer) UpdateResourceGroups(ctx context.Context, req *milvuspb.UpdateResourceGroupsRequest) (*commonpb.Status, error) { +func (m *MockServer) UpdateResourceGroups(_ context.Context, _ *milvuspb.UpdateResourceGroupsRequest) (*commonpb.Status, error) { return nil, errors.New("not implemented") }