diff --git a/admin/commands/pmm/server/docker/deps.go b/admin/commands/pmm/server/docker/deps.go index b50e1d3ae2..45664aa57b 100644 --- a/admin/commands/pmm/server/docker/deps.go +++ b/admin/commands/pmm/server/docker/deps.go @@ -27,7 +27,7 @@ import ( "github.com/percona/pmm/admin/pkg/docker" ) -//go:generate ../../../../../bin/mockery -name=Functions -case=snake -inpkg -testonly +//go:generate ../../../../../bin/mockery --name=Functions --case=snake --inpackage --testonly // Functions contain methods required to interact with Docker. type Functions interface { //nolint:interfacebloat diff --git a/admin/commands/pmm/server/docker/mock_functions_test.go b/admin/commands/pmm/server/docker/mock_functions_test.go index bdb8413c80..8841c6a2d8 100644 --- a/admin/commands/pmm/server/docker/mock_functions_test.go +++ b/admin/commands/pmm/server/docker/mock_functions_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package docker @@ -13,7 +13,7 @@ import ( client "github.com/docker/docker/client" mock "github.com/stretchr/testify/mock" - "github.com/percona/pmm/admin/pkg/docker" + pkgdocker "github.com/percona/pmm/admin/pkg/docker" ) // MockFunctions is an autogenerated mock type for the Functions type @@ -40,13 +40,16 @@ func (_m *MockFunctions) ContainerInspect(ctx context.Context, containerID strin ret := _m.Called(ctx, containerID) var r0 types.ContainerJSON + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (types.ContainerJSON, error)); ok { + return rf(ctx, containerID) + } if rf, ok := ret.Get(0).(func(context.Context, string) types.ContainerJSON); ok { r0 = rf(ctx, containerID) } else { r0 = ret.Get(0).(types.ContainerJSON) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, containerID) } else { @@ -75,13 +78,16 @@ func (_m *MockFunctions) ContainerUpdate(ctx context.Context, containerID string ret := _m.Called(ctx, containerID, updateConfig) var r0 container.ContainerUpdateOKBody + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, container.UpdateConfig) (container.ContainerUpdateOKBody, error)); ok { + return rf(ctx, containerID, updateConfig) + } if rf, ok := ret.Get(0).(func(context.Context, string, container.UpdateConfig) container.ContainerUpdateOKBody); ok { r0 = rf(ctx, containerID, updateConfig) } else { r0 = ret.Get(0).(container.ContainerUpdateOKBody) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, container.UpdateConfig) error); ok { r1 = rf(ctx, containerID, updateConfig) } else { @@ -96,6 +102,10 @@ func (_m *MockFunctions) ContainerWait(ctx context.Context, containerID string, ret := _m.Called(ctx, containerID, condition) var r0 <-chan container.WaitResponse + var r1 <-chan error + if rf, ok := ret.Get(0).(func(context.Context, string, container.WaitCondition) (<-chan container.WaitResponse, <-chan error)); ok { + return rf(ctx, containerID, condition) + } if rf, ok := ret.Get(0).(func(context.Context, string, container.WaitCondition) <-chan container.WaitResponse); ok { r0 = rf(ctx, containerID, condition) } else { @@ -104,7 +114,6 @@ func (_m *MockFunctions) ContainerWait(ctx context.Context, containerID string, } } - var r1 <-chan error if rf, ok := ret.Get(1).(func(context.Context, string, container.WaitCondition) <-chan error); ok { r1 = rf(ctx, containerID, condition) } else { @@ -121,6 +130,10 @@ func (_m *MockFunctions) CreateVolume(ctx context.Context, volumeName string, la ret := _m.Called(ctx, volumeName, labels) var r0 *volume.Volume + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, map[string]string) (*volume.Volume, error)); ok { + return rf(ctx, volumeName, labels) + } if rf, ok := ret.Get(0).(func(context.Context, string, map[string]string) *volume.Volume); ok { r0 = rf(ctx, volumeName, labels) } else { @@ -129,7 +142,6 @@ func (_m *MockFunctions) CreateVolume(ctx context.Context, volumeName string, la } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, map[string]string) error); ok { r1 = rf(ctx, volumeName, labels) } else { @@ -144,6 +156,10 @@ func (_m *MockFunctions) FindServerContainers(ctx context.Context) ([]types.Cont ret := _m.Called(ctx) var r0 []types.Container + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) ([]types.Container, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) []types.Container); ok { r0 = rf(ctx) } else { @@ -152,7 +168,6 @@ func (_m *MockFunctions) FindServerContainers(ctx context.Context) ([]types.Cont } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -211,13 +226,16 @@ func (_m *MockFunctions) IsDockerInstalled() (bool, error) { ret := _m.Called() var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func() (bool, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -232,6 +250,10 @@ func (_m *MockFunctions) ParsePullImageProgress(r io.Reader, p *tea.Program) (<- ret := _m.Called(r, p) var r0 <-chan struct{} + var r1 <-chan error + if rf, ok := ret.Get(0).(func(io.Reader, *tea.Program) (<-chan struct{}, <-chan error)); ok { + return rf(r, p) + } if rf, ok := ret.Get(0).(func(io.Reader, *tea.Program) <-chan struct{}); ok { r0 = rf(r, p) } else { @@ -240,7 +262,6 @@ func (_m *MockFunctions) ParsePullImageProgress(r io.Reader, p *tea.Program) (<- } } - var r1 <-chan error if rf, ok := ret.Get(1).(func(io.Reader, *tea.Program) <-chan error); ok { r1 = rf(r, p) } else { @@ -257,6 +278,10 @@ func (_m *MockFunctions) PullImage(ctx context.Context, dockerImage string, opts ret := _m.Called(ctx, dockerImage, opts) var r0 io.Reader + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, types.ImagePullOptions) (io.Reader, error)); ok { + return rf(ctx, dockerImage, opts) + } if rf, ok := ret.Get(0).(func(context.Context, string, types.ImagePullOptions) io.Reader); ok { r0 = rf(ctx, dockerImage, opts) } else { @@ -265,7 +290,6 @@ func (_m *MockFunctions) PullImage(ctx context.Context, dockerImage string, opts } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, types.ImagePullOptions) error); ok { r1 = rf(ctx, dockerImage, opts) } else { @@ -280,13 +304,16 @@ func (_m *MockFunctions) RunContainer(ctx context.Context, config *container.Con ret := _m.Called(ctx, config, hostConfig, containerName) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *container.Config, *container.HostConfig, string) (string, error)); ok { + return rf(ctx, config, hostConfig, containerName) + } if rf, ok := ret.Get(0).(func(context.Context, *container.Config, *container.HostConfig, string) string); ok { r0 = rf(ctx, config, hostConfig, containerName) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *container.Config, *container.HostConfig, string) error); ok { r1 = rf(ctx, config, hostConfig, containerName) } else { @@ -297,17 +324,32 @@ func (_m *MockFunctions) RunContainer(ctx context.Context, config *container.Con } // WaitForHealthyContainer provides a mock function with given fields: ctx, containerID -func (_m *MockFunctions) WaitForHealthyContainer(ctx context.Context, containerID string) <-chan docker.WaitHealthyResponse { +func (_m *MockFunctions) WaitForHealthyContainer(ctx context.Context, containerID string) <-chan pkgdocker.WaitHealthyResponse { ret := _m.Called(ctx, containerID) - var r0 <-chan docker.WaitHealthyResponse - if rf, ok := ret.Get(0).(func(context.Context, string) <-chan docker.WaitHealthyResponse); ok { + var r0 <-chan pkgdocker.WaitHealthyResponse + if rf, ok := ret.Get(0).(func(context.Context, string) <-chan pkgdocker.WaitHealthyResponse); ok { r0 = rf(ctx, containerID) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(<-chan docker.WaitHealthyResponse) + r0 = ret.Get(0).(<-chan pkgdocker.WaitHealthyResponse) } } return r0 } + +// NewMockFunctions creates a new instance of MockFunctions. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockFunctions(t interface { + mock.TestingT + Cleanup(func()) +}, +) *MockFunctions { + mock := &MockFunctions{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/agent/agentlocal/deps.go b/agent/agentlocal/deps.go index 8ff7b79c3b..b948131412 100644 --- a/agent/agentlocal/deps.go +++ b/agent/agentlocal/deps.go @@ -23,8 +23,8 @@ import ( "github.com/percona/pmm/api/agentpb" ) -//go:generate ../../bin/mockery -name=client -case=snake -inpkg -testonly -//go:generate ../../bin/mockery -name=supervisor -case=snake -inpkg -testonly +//go:generate ../../bin/mockery --name=client --case=snake --inpackage --testonly +//go:generate ../../bin/mockery --name=supervisor --case=snake --inpackage --testonly // client is a subset of methods of client.Client used by this package. // We use it instead of real type for testing and to avoid dependency cycle. diff --git a/agent/agentlocal/mock_client_test.go b/agent/agentlocal/mock_client_test.go index 4714bf1a41..bbb4506d1c 100644 --- a/agent/agentlocal/mock_client_test.go +++ b/agent/agentlocal/mock_client_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package agentlocal @@ -45,20 +45,23 @@ func (_m *mockClient) GetNetworkInformation() (time.Duration, time.Duration, err ret := _m.Called() var r0 time.Duration + var r1 time.Duration + var r2 error + if rf, ok := ret.Get(0).(func() (time.Duration, time.Duration, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() time.Duration); ok { r0 = rf() } else { r0 = ret.Get(0).(time.Duration) } - var r1 time.Duration if rf, ok := ret.Get(1).(func() time.Duration); ok { r1 = rf() } else { r1 = ret.Get(1).(time.Duration) } - var r2 error if rf, ok := ret.Get(2).(func() error); ok { r2 = rf() } else { @@ -83,3 +86,18 @@ func (_m *mockClient) GetServerConnectMetadata() *agentpb.ServerConnectMetadata return r0 } + +// newMockClient creates a new instance of mockClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockClient(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockClient { + mock := &mockClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/agent/agentlocal/mock_supervisor_test.go b/agent/agentlocal/mock_supervisor_test.go index 1fbcbc0cc0..442d1b4994 100644 --- a/agent/agentlocal/mock_supervisor_test.go +++ b/agent/agentlocal/mock_supervisor_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package agentlocal @@ -44,3 +44,18 @@ func (_m *mockSupervisor) AgentsLogs() map[string][]string { return r0 } + +// newMockSupervisor creates a new instance of mockSupervisor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockSupervisor(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockSupervisor { + mock := &mockSupervisor{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/agent/client/deps.go b/agent/client/deps.go index 830ff9dfac..4310931445 100644 --- a/agent/client/deps.go +++ b/agent/client/deps.go @@ -23,8 +23,8 @@ import ( "github.com/percona/pmm/api/agentpb" ) -//go:generate ../../bin/mockery -name=connectionChecker -case=snake -inpkg -testonly -//go:generate ../../bin/mockery -name=supervisor -case=snake -inpkg -testonly +//go:generate ../../bin/mockery --name=connectionChecker --case=snake --inpackage --testonly +//go:generate ../../bin/mockery --name=supervisor --case=snake --inpackage --testonly // connectionChecker is a subset of methods of connectionchecker.ConnectionChecker used by this package. // We use it instead of real type for testing and to avoid dependency cycle. diff --git a/agent/client/mock_connection_checker_test.go b/agent/client/mock_connection_checker_test.go index 77e0a17cb9..c1369d5718 100644 --- a/agent/client/mock_connection_checker_test.go +++ b/agent/client/mock_connection_checker_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package client @@ -30,3 +30,18 @@ func (_m *mockConnectionChecker) Check(ctx context.Context, req *agentpb.CheckCo return r0 } + +// newMockConnectionChecker creates a new instance of mockConnectionChecker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockConnectionChecker(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockConnectionChecker { + mock := &mockConnectionChecker{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/agent/client/mock_supervisor_test.go b/agent/client/mock_supervisor_test.go index 9e96ef2a92..84c02b68a1 100644 --- a/agent/client/mock_supervisor_test.go +++ b/agent/client/mock_supervisor_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package client @@ -20,6 +20,10 @@ func (_m *mockSupervisor) AgentLogByID(_a0 string) ([]string, uint) { ret := _m.Called(_a0) var r0 []string + var r1 uint + if rf, ok := ret.Get(0).(func(string) ([]string, uint)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(string) []string); ok { r0 = rf(_a0) } else { @@ -28,7 +32,6 @@ func (_m *mockSupervisor) AgentLogByID(_a0 string) ([]string, uint) { } } - var r1 uint if rf, ok := ret.Get(1).(func(string) uint); ok { r1 = rf(_a0) } else { @@ -110,3 +113,18 @@ func (_m *mockSupervisor) RestartAgents() { func (_m *mockSupervisor) SetState(_a0 *agentpb.SetStateRequest) { _m.Called(_a0) } + +// newMockSupervisor creates a new instance of mockSupervisor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockSupervisor(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockSupervisor { + mock := &mockSupervisor{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/agent/versioner/mock_exec_functions_test.go b/agent/versioner/mock_exec_functions_test.go index 7d664f0390..cef0d3136a 100644 --- a/agent/versioner/mock_exec_functions_test.go +++ b/agent/versioner/mock_exec_functions_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package versioner @@ -41,13 +41,16 @@ func (_m *MockExecFunctions) LookPath(file string) (string, error) { ret := _m.Called(file) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(string) (string, error)); ok { + return rf(file) + } if rf, ok := ret.Get(0).(func(string) string); ok { r0 = rf(file) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(file) } else { @@ -56,3 +59,18 @@ func (_m *MockExecFunctions) LookPath(file string) (string, error) { return r0, r1 } + +// NewMockExecFunctions creates a new instance of MockExecFunctions. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockExecFunctions(t interface { + mock.TestingT + Cleanup(func()) +}, +) *MockExecFunctions { + mock := &MockExecFunctions{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/agent/versioner/versioner.go b/agent/versioner/versioner.go index 9e737e230c..8cb4a12191 100644 --- a/agent/versioner/versioner.go +++ b/agent/versioner/versioner.go @@ -51,7 +51,7 @@ type CombinedOutputer interface { CombinedOutput() ([]byte, error) } -//go:generate ../../bin/mockery -name=ExecFunctions -case=snake -inpkg -testonly +//go:generate ../../bin/mockery --name=ExecFunctions --case=snake --inpackage --testonly // ExecFunctions is an interface for the LookPath() and CommandContext() functions. type ExecFunctions interface { diff --git a/managed/services/backup/deps.go b/managed/services/backup/deps.go index 07c73cfe0d..86c0caf8a4 100644 --- a/managed/services/backup/deps.go +++ b/managed/services/backup/deps.go @@ -24,13 +24,13 @@ import ( "github.com/percona/pmm/managed/services/minio" ) -//go:generate ../../../bin/mockery -name=jobsService -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=agentService -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=versioner -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=compatibilityService -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=pbmPITRService -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=Storage -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=removalService -case=snake -inpkg -testonly +//go:generate ../../../bin/mockery --name=jobsService --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=agentService --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=versioner --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=compatibilityService --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=pbmPITRService --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=Storage --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=removalService --case=snake --inpackage --testonly // jobsService is a subset of methods of agents.JobsService used by this package. // We use it instead of real type for testing and to avoid dependency cycle. diff --git a/managed/services/backup/mock_agent_service_test.go b/managed/services/backup/mock_agent_service_test.go index 9c5b5f0505..3be56de1ac 100644 --- a/managed/services/backup/mock_agent_service_test.go +++ b/managed/services/backup/mock_agent_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package backup @@ -26,3 +26,18 @@ func (_m *mockAgentService) PBMSwitchPITR(pmmAgentID string, dsn string, files m return r0 } + +// newMockAgentService creates a new instance of mockAgentService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockAgentService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockAgentService { + mock := &mockAgentService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/backup/mock_compatibility_service_test.go b/managed/services/backup/mock_compatibility_service_test.go index c974271e2b..e0cf6b26df 100644 --- a/managed/services/backup/mock_compatibility_service_test.go +++ b/managed/services/backup/mock_compatibility_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package backup @@ -32,13 +32,16 @@ func (_m *mockCompatibilityService) CheckSoftwareCompatibilityForService(ctx con ret := _m.Called(ctx, serviceID) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok { + return rf(ctx, serviceID) + } if rf, ok := ret.Get(0).(func(context.Context, string) string); ok { r0 = rf(ctx, serviceID) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, serviceID) } else { @@ -47,3 +50,18 @@ func (_m *mockCompatibilityService) CheckSoftwareCompatibilityForService(ctx con return r0, r1 } + +// newMockCompatibilityService creates a new instance of mockCompatibilityService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockCompatibilityService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockCompatibilityService { + mock := &mockCompatibilityService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/backup/mock_jobs_service_test.go b/managed/services/backup/mock_jobs_service_test.go index 34b0028815..b85845eb81 100644 --- a/managed/services/backup/mock_jobs_service_test.go +++ b/managed/services/backup/mock_jobs_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package backup @@ -84,3 +84,18 @@ func (_m *mockJobsService) StopJob(jobID string) error { return r0 } + +// newMockJobsService creates a new instance of mockJobsService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockJobsService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockJobsService { + mock := &mockJobsService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/backup/mock_pbm_pitr_service_test.go b/managed/services/backup/mock_pbm_pitr_service_test.go index 104259ebe8..b9a9bd71dd 100644 --- a/managed/services/backup/mock_pbm_pitr_service_test.go +++ b/managed/services/backup/mock_pbm_pitr_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package backup @@ -21,6 +21,10 @@ func (_m *mockPbmPITRService) GetPITRFiles(ctx context.Context, locationClient S ret := _m.Called(ctx, locationClient, location, artifact, until) var r0 []*oplogChunk + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, Storage, *models.BackupLocation, *models.Artifact, *time.Time) ([]*oplogChunk, error)); ok { + return rf(ctx, locationClient, location, artifact, until) + } if rf, ok := ret.Get(0).(func(context.Context, Storage, *models.BackupLocation, *models.Artifact, *time.Time) []*oplogChunk); ok { r0 = rf(ctx, locationClient, location, artifact, until) } else { @@ -29,7 +33,6 @@ func (_m *mockPbmPITRService) GetPITRFiles(ctx context.Context, locationClient S } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, Storage, *models.BackupLocation, *models.Artifact, *time.Time) error); ok { r1 = rf(ctx, locationClient, location, artifact, until) } else { @@ -44,6 +47,10 @@ func (_m *mockPbmPITRService) ListPITRTimeranges(ctx context.Context, locationCl ret := _m.Called(ctx, locationClient, location, artifact) var r0 []Timeline + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, Storage, *models.BackupLocation, *models.Artifact) ([]Timeline, error)); ok { + return rf(ctx, locationClient, location, artifact) + } if rf, ok := ret.Get(0).(func(context.Context, Storage, *models.BackupLocation, *models.Artifact) []Timeline); ok { r0 = rf(ctx, locationClient, location, artifact) } else { @@ -52,7 +59,6 @@ func (_m *mockPbmPITRService) ListPITRTimeranges(ctx context.Context, locationCl } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, Storage, *models.BackupLocation, *models.Artifact) error); ok { r1 = rf(ctx, locationClient, location, artifact) } else { @@ -61,3 +67,18 @@ func (_m *mockPbmPITRService) ListPITRTimeranges(ctx context.Context, locationCl return r0, r1 } + +// newMockPbmPITRService creates a new instance of mockPbmPITRService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockPbmPITRService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockPbmPITRService { + mock := &mockPbmPITRService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/backup/mock_removal_service_test.go b/managed/services/backup/mock_removal_service_test.go index b7b7675a35..8fcd7e6ef4 100644 --- a/managed/services/backup/mock_removal_service_test.go +++ b/managed/services/backup/mock_removal_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package backup @@ -36,3 +36,18 @@ func (_m *mockRemovalService) TrimPITRArtifact(storage Storage, artifactID strin return r0 } + +// newMockRemovalService creates a new instance of mockRemovalService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockRemovalService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockRemovalService { + mock := &mockRemovalService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/backup/mock_storage_test.go b/managed/services/backup/mock_storage_test.go index 5de2ba4101..699052bd20 100644 --- a/managed/services/backup/mock_storage_test.go +++ b/managed/services/backup/mock_storage_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package backup @@ -20,13 +20,16 @@ func (_m *MockStorage) FileStat(ctx context.Context, endpoint string, accessKey ret := _m.Called(ctx, endpoint, accessKey, secretKey, bucketName, name) var r0 minio.FileInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, string) (minio.FileInfo, error)); ok { + return rf(ctx, endpoint, accessKey, secretKey, bucketName, name) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, string) minio.FileInfo); ok { r0 = rf(ctx, endpoint, accessKey, secretKey, bucketName, name) } else { r0 = ret.Get(0).(minio.FileInfo) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string, string) error); ok { r1 = rf(ctx, endpoint, accessKey, secretKey, bucketName, name) } else { @@ -41,6 +44,10 @@ func (_m *MockStorage) List(ctx context.Context, endpoint string, accessKey stri ret := _m.Called(ctx, endpoint, accessKey, secretKey, bucketName, prefix, suffix) var r0 []minio.FileInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, string, string) ([]minio.FileInfo, error)); ok { + return rf(ctx, endpoint, accessKey, secretKey, bucketName, prefix, suffix) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, string, string) []minio.FileInfo); ok { r0 = rf(ctx, endpoint, accessKey, secretKey, bucketName, prefix, suffix) } else { @@ -49,7 +56,6 @@ func (_m *MockStorage) List(ctx context.Context, endpoint string, accessKey stri } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string, string, string) error); ok { r1 = rf(ctx, endpoint, accessKey, secretKey, bucketName, prefix, suffix) } else { @@ -86,3 +92,18 @@ func (_m *MockStorage) RemoveRecursive(ctx context.Context, endpoint string, acc return r0 } + +// NewMockStorage creates a new instance of MockStorage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockStorage(t interface { + mock.TestingT + Cleanup(func()) +}, +) *MockStorage { + mock := &MockStorage{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/backup/mock_versioner_test.go b/managed/services/backup/mock_versioner_test.go index b577a352fb..10830471f6 100644 --- a/managed/services/backup/mock_versioner_test.go +++ b/managed/services/backup/mock_versioner_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package backup @@ -18,6 +18,10 @@ func (_m *mockVersioner) GetVersions(pmmAgentID string, softwares []agents.Softw ret := _m.Called(pmmAgentID, softwares) var r0 []agents.Version + var r1 error + if rf, ok := ret.Get(0).(func(string, []agents.Software) ([]agents.Version, error)); ok { + return rf(pmmAgentID, softwares) + } if rf, ok := ret.Get(0).(func(string, []agents.Software) []agents.Version); ok { r0 = rf(pmmAgentID, softwares) } else { @@ -26,7 +30,6 @@ func (_m *mockVersioner) GetVersions(pmmAgentID string, softwares []agents.Softw } } - var r1 error if rf, ok := ret.Get(1).(func(string, []agents.Software) error); ok { r1 = rf(pmmAgentID, softwares) } else { @@ -35,3 +38,18 @@ func (_m *mockVersioner) GetVersions(pmmAgentID string, softwares []agents.Softw return r0, r1 } + +// newMockVersioner creates a new instance of mockVersioner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockVersioner(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockVersioner { + mock := &mockVersioner{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/checks/deps.go b/managed/services/checks/deps.go index 66892e9450..d4b3feeccb 100644 --- a/managed/services/checks/deps.go +++ b/managed/services/checks/deps.go @@ -23,8 +23,8 @@ import ( "github.com/percona/pmm/managed/services" ) -//go:generate ../../../bin/mockery -name=agentsRegistry -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=alertmanagerService -case=snake -inpkg -testonly +//go:generate ../../../bin/mockery --name=agentsRegistry --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=alertmanagerService --case=snake --inpackage --testonly // agentsRegistry is a subset of methods of agents.Registry used by this package. // We use it instead of real type for testing and to avoid dependency cycle. diff --git a/managed/services/checks/mock_agents_registry_test.go b/managed/services/checks/mock_agents_registry_test.go index 5c0027ddc8..4783d9703e 100644 --- a/managed/services/checks/mock_agents_registry_test.go +++ b/managed/services/checks/mock_agents_registry_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package checks @@ -140,3 +140,18 @@ func (_m *mockAgentsRegistry) StartPostgreSQLQueryShowAction(ctx context.Context return r0 } + +// newMockAgentsRegistry creates a new instance of mockAgentsRegistry. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockAgentsRegistry(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockAgentsRegistry { + mock := &mockAgentsRegistry{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/checks/mock_alertmanager_service_test.go b/managed/services/checks/mock_alertmanager_service_test.go index 305c5cd65b..0b3c450ce2 100644 --- a/managed/services/checks/mock_alertmanager_service_test.go +++ b/managed/services/checks/mock_alertmanager_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package checks @@ -21,6 +21,10 @@ func (_m *mockAlertmanagerService) GetAlerts(ctx context.Context, params *servic ret := _m.Called(ctx, params) var r0 []*ammodels.GettableAlert + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *services.FilterParams) ([]*ammodels.GettableAlert, error)); ok { + return rf(ctx, params) + } if rf, ok := ret.Get(0).(func(context.Context, *services.FilterParams) []*ammodels.GettableAlert); ok { r0 = rf(ctx, params) } else { @@ -29,7 +33,6 @@ func (_m *mockAlertmanagerService) GetAlerts(ctx context.Context, params *servic } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *services.FilterParams) error); ok { r1 = rf(ctx, params) } else { @@ -71,3 +74,18 @@ func (_m *mockAlertmanagerService) UnsilenceAlerts(ctx context.Context, alerts [ return r0 } + +// newMockAlertmanagerService creates a new instance of mockAlertmanagerService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockAlertmanagerService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockAlertmanagerService { + mock := &mockAlertmanagerService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/dbaas/kubernetes/client/gen.go b/managed/services/dbaas/kubernetes/client/gen.go index e2c6ee6c7a..fe733886cf 100644 --- a/managed/services/dbaas/kubernetes/client/gen.go +++ b/managed/services/dbaas/kubernetes/client/gen.go @@ -16,4 +16,4 @@ package client //go:generate ../../../../../bin/ifacemaker -f client.go -s Client -i KubeClientConnector -p client -o kubeclient_interface.go -//go:generate ../../../../../bin/mockery -name=KubeClientConnector -case=snake -inpkg +//go:generate ../../../../../bin/mockery --name=KubeClientConnector --case=snake --inpackage diff --git a/managed/services/dbaas/kubernetes/client/mock_kube_client_connector.go b/managed/services/dbaas/kubernetes/client/mock_kube_client_connector.go index 5f5c876978..cc28b426e8 100644 --- a/managed/services/dbaas/kubernetes/client/mock_kube_client_connector.go +++ b/managed/services/dbaas/kubernetes/client/mock_kube_client_connector.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package client @@ -59,6 +59,10 @@ func (_m *MockKubeClientConnector) CreateOperatorGroup(ctx context.Context, name ret := _m.Called(ctx, namespace, name) var r0 *v1.OperatorGroup + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*v1.OperatorGroup, error)); ok { + return rf(ctx, namespace, name) + } if rf, ok := ret.Get(0).(func(context.Context, string, string) *v1.OperatorGroup); ok { r0 = rf(ctx, namespace, name) } else { @@ -67,7 +71,6 @@ func (_m *MockKubeClientConnector) CreateOperatorGroup(ctx context.Context, name } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { r1 = rf(ctx, namespace, name) } else { @@ -82,6 +85,10 @@ func (_m *MockKubeClientConnector) CreateSubscriptionForCatalog(ctx context.Cont ret := _m.Called(ctx, namespace, name, catalogNamespace, catalog, packageName, channel, startingCSV, approval) var r0 *v1alpha1.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, string, string, string, v1alpha1.Approval) (*v1alpha1.Subscription, error)); ok { + return rf(ctx, namespace, name, catalogNamespace, catalog, packageName, channel, startingCSV, approval) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, string, string, string, v1alpha1.Approval) *v1alpha1.Subscription); ok { r0 = rf(ctx, namespace, name, catalogNamespace, catalog, packageName, channel, startingCSV, approval) } else { @@ -90,7 +97,6 @@ func (_m *MockKubeClientConnector) CreateSubscriptionForCatalog(ctx context.Cont } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string, string, string, string, v1alpha1.Approval) error); ok { r1 = rf(ctx, namespace, name, catalogNamespace, catalog, packageName, channel, startingCSV, approval) } else { @@ -147,6 +153,10 @@ func (_m *MockKubeClientConnector) GenerateKubeConfig(secret *corev1.Secret) ([] ret := _m.Called(secret) var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func(*corev1.Secret) ([]byte, error)); ok { + return rf(secret) + } if rf, ok := ret.Get(0).(func(*corev1.Secret) []byte); ok { r0 = rf(secret) } else { @@ -155,7 +165,6 @@ func (_m *MockKubeClientConnector) GenerateKubeConfig(secret *corev1.Secret) ([] } } - var r1 error if rf, ok := ret.Get(1).(func(*corev1.Secret) error); ok { r1 = rf(secret) } else { @@ -170,6 +179,10 @@ func (_m *MockKubeClientConnector) GetDatabaseCluster(ctx context.Context, name ret := _m.Called(ctx, name) var r0 *apiv1.DatabaseCluster + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*apiv1.DatabaseCluster, error)); ok { + return rf(ctx, name) + } if rf, ok := ret.Get(0).(func(context.Context, string) *apiv1.DatabaseCluster); ok { r0 = rf(ctx, name) } else { @@ -178,7 +191,6 @@ func (_m *MockKubeClientConnector) GetDatabaseCluster(ctx context.Context, name } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, name) } else { @@ -193,6 +205,10 @@ func (_m *MockKubeClientConnector) GetDeployment(ctx context.Context, name strin ret := _m.Called(ctx, name) var r0 *appsv1.Deployment + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*appsv1.Deployment, error)); ok { + return rf(ctx, name) + } if rf, ok := ret.Get(0).(func(context.Context, string) *appsv1.Deployment); ok { r0 = rf(ctx, name) } else { @@ -201,7 +217,6 @@ func (_m *MockKubeClientConnector) GetDeployment(ctx context.Context, name strin } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, name) } else { @@ -216,13 +231,16 @@ func (_m *MockKubeClientConnector) GetEvents(ctx context.Context, name string) ( ret := _m.Called(ctx, name) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok { + return rf(ctx, name) + } if rf, ok := ret.Get(0).(func(context.Context, string) string); ok { r0 = rf(ctx, name) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, name) } else { @@ -237,6 +255,10 @@ func (_m *MockKubeClientConnector) GetInstallPlan(ctx context.Context, namespace ret := _m.Called(ctx, namespace, name) var r0 *v1alpha1.InstallPlan + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*v1alpha1.InstallPlan, error)); ok { + return rf(ctx, namespace, name) + } if rf, ok := ret.Get(0).(func(context.Context, string, string) *v1alpha1.InstallPlan); ok { r0 = rf(ctx, namespace, name) } else { @@ -245,7 +267,6 @@ func (_m *MockKubeClientConnector) GetInstallPlan(ctx context.Context, namespace } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { r1 = rf(ctx, namespace, name) } else { @@ -260,13 +281,16 @@ func (_m *MockKubeClientConnector) GetLogs(ctx context.Context, pod string, cont ret := _m.Called(ctx, pod, container) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (string, error)); ok { + return rf(ctx, pod, container) + } if rf, ok := ret.Get(0).(func(context.Context, string, string) string); ok { r0 = rf(ctx, pod, container) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { r1 = rf(ctx, pod, container) } else { @@ -281,6 +305,10 @@ func (_m *MockKubeClientConnector) GetNodes(ctx context.Context) (*corev1.NodeLi ret := _m.Called(ctx) var r0 *corev1.NodeList + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*corev1.NodeList, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) *corev1.NodeList); ok { r0 = rf(ctx) } else { @@ -289,7 +317,6 @@ func (_m *MockKubeClientConnector) GetNodes(ctx context.Context) (*corev1.NodeLi } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -304,6 +331,10 @@ func (_m *MockKubeClientConnector) GetOperatorGroup(ctx context.Context, namespa ret := _m.Called(ctx, namespace, name) var r0 *v1.OperatorGroup + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*v1.OperatorGroup, error)); ok { + return rf(ctx, namespace, name) + } if rf, ok := ret.Get(0).(func(context.Context, string, string) *v1.OperatorGroup); ok { r0 = rf(ctx, namespace, name) } else { @@ -312,7 +343,6 @@ func (_m *MockKubeClientConnector) GetOperatorGroup(ctx context.Context, namespa } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { r1 = rf(ctx, namespace, name) } else { @@ -327,6 +357,10 @@ func (_m *MockKubeClientConnector) GetPersistentVolumes(ctx context.Context) (*c ret := _m.Called(ctx) var r0 *corev1.PersistentVolumeList + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*corev1.PersistentVolumeList, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) *corev1.PersistentVolumeList); ok { r0 = rf(ctx) } else { @@ -335,7 +369,6 @@ func (_m *MockKubeClientConnector) GetPersistentVolumes(ctx context.Context) (*c } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -350,6 +383,10 @@ func (_m *MockKubeClientConnector) GetPods(ctx context.Context, namespace string ret := _m.Called(ctx, namespace, labelSelector) var r0 *corev1.PodList + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, *metav1.LabelSelector) (*corev1.PodList, error)); ok { + return rf(ctx, namespace, labelSelector) + } if rf, ok := ret.Get(0).(func(context.Context, string, *metav1.LabelSelector) *corev1.PodList); ok { r0 = rf(ctx, namespace, labelSelector) } else { @@ -358,7 +395,6 @@ func (_m *MockKubeClientConnector) GetPods(ctx context.Context, namespace string } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, *metav1.LabelSelector) error); ok { r1 = rf(ctx, namespace, labelSelector) } else { @@ -373,6 +409,10 @@ func (_m *MockKubeClientConnector) GetSecret(ctx context.Context, name string) ( ret := _m.Called(ctx, name) var r0 *corev1.Secret + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*corev1.Secret, error)); ok { + return rf(ctx, name) + } if rf, ok := ret.Get(0).(func(context.Context, string) *corev1.Secret); ok { r0 = rf(ctx, name) } else { @@ -381,7 +421,6 @@ func (_m *MockKubeClientConnector) GetSecret(ctx context.Context, name string) ( } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, name) } else { @@ -396,6 +435,10 @@ func (_m *MockKubeClientConnector) GetSecretsForServiceAccount(ctx context.Conte ret := _m.Called(ctx, accountName) var r0 *corev1.Secret + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*corev1.Secret, error)); ok { + return rf(ctx, accountName) + } if rf, ok := ret.Get(0).(func(context.Context, string) *corev1.Secret); ok { r0 = rf(ctx, accountName) } else { @@ -404,7 +447,6 @@ func (_m *MockKubeClientConnector) GetSecretsForServiceAccount(ctx context.Conte } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, accountName) } else { @@ -419,6 +461,10 @@ func (_m *MockKubeClientConnector) GetServerVersion() (*version.Info, error) { ret := _m.Called() var r0 *version.Info + var r1 error + if rf, ok := ret.Get(0).(func() (*version.Info, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() *version.Info); ok { r0 = rf() } else { @@ -427,7 +473,6 @@ func (_m *MockKubeClientConnector) GetServerVersion() (*version.Info, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -442,6 +487,10 @@ func (_m *MockKubeClientConnector) GetStorageClasses(ctx context.Context) (*stor ret := _m.Called(ctx) var r0 *storagev1.StorageClassList + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*storagev1.StorageClassList, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) *storagev1.StorageClassList); ok { r0 = rf(ctx) } else { @@ -450,7 +499,6 @@ func (_m *MockKubeClientConnector) GetStorageClasses(ctx context.Context) (*stor } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -465,6 +513,10 @@ func (_m *MockKubeClientConnector) GetSubscription(ctx context.Context, namespac ret := _m.Called(ctx, namespace, name) var r0 *v1alpha1.Subscription + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*v1alpha1.Subscription, error)); ok { + return rf(ctx, namespace, name) + } if rf, ok := ret.Get(0).(func(context.Context, string, string) *v1alpha1.Subscription); ok { r0 = rf(ctx, namespace, name) } else { @@ -473,7 +525,6 @@ func (_m *MockKubeClientConnector) GetSubscription(ctx context.Context, namespac } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { r1 = rf(ctx, namespace, name) } else { @@ -488,13 +539,16 @@ func (_m *MockKubeClientConnector) GetSubscriptionCSV(ctx context.Context, subKe ret := _m.Called(ctx, subKey) var r0 types.NamespacedName + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.NamespacedName) (types.NamespacedName, error)); ok { + return rf(ctx, subKey) + } if rf, ok := ret.Get(0).(func(context.Context, types.NamespacedName) types.NamespacedName); ok { r0 = rf(ctx, subKey) } else { r0 = ret.Get(0).(types.NamespacedName) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.NamespacedName) error); ok { r1 = rf(ctx, subKey) } else { @@ -509,6 +563,10 @@ func (_m *MockKubeClientConnector) ListCRDs(ctx context.Context, labelSelector * ret := _m.Called(ctx, labelSelector) var r0 *apiextensionsv1.CustomResourceDefinitionList + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *metav1.LabelSelector) (*apiextensionsv1.CustomResourceDefinitionList, error)); ok { + return rf(ctx, labelSelector) + } if rf, ok := ret.Get(0).(func(context.Context, *metav1.LabelSelector) *apiextensionsv1.CustomResourceDefinitionList); ok { r0 = rf(ctx, labelSelector) } else { @@ -517,7 +575,6 @@ func (_m *MockKubeClientConnector) ListCRDs(ctx context.Context, labelSelector * } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *metav1.LabelSelector) error); ok { r1 = rf(ctx, labelSelector) } else { @@ -532,6 +589,10 @@ func (_m *MockKubeClientConnector) ListCRs(ctx context.Context, namespace string ret := _m.Called(ctx, namespace, gvr, labelSelector) var r0 *unstructured.UnstructuredList + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, schema.GroupVersionResource, *metav1.LabelSelector) (*unstructured.UnstructuredList, error)); ok { + return rf(ctx, namespace, gvr, labelSelector) + } if rf, ok := ret.Get(0).(func(context.Context, string, schema.GroupVersionResource, *metav1.LabelSelector) *unstructured.UnstructuredList); ok { r0 = rf(ctx, namespace, gvr, labelSelector) } else { @@ -540,7 +601,6 @@ func (_m *MockKubeClientConnector) ListCRs(ctx context.Context, namespace string } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, schema.GroupVersionResource, *metav1.LabelSelector) error); ok { r1 = rf(ctx, namespace, gvr, labelSelector) } else { @@ -555,6 +615,10 @@ func (_m *MockKubeClientConnector) ListDatabaseClusters(ctx context.Context) (*a ret := _m.Called(ctx) var r0 *apiv1.DatabaseClusterList + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*apiv1.DatabaseClusterList, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) *apiv1.DatabaseClusterList); ok { r0 = rf(ctx) } else { @@ -563,7 +627,6 @@ func (_m *MockKubeClientConnector) ListDatabaseClusters(ctx context.Context) (*a } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -578,6 +641,10 @@ func (_m *MockKubeClientConnector) ListSecrets(ctx context.Context) (*corev1.Sec ret := _m.Called(ctx) var r0 *corev1.SecretList + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*corev1.SecretList, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) *corev1.SecretList); ok { r0 = rf(ctx) } else { @@ -586,7 +653,6 @@ func (_m *MockKubeClientConnector) ListSecrets(ctx context.Context) (*corev1.Sec } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -601,6 +667,10 @@ func (_m *MockKubeClientConnector) ListSubscriptions(ctx context.Context, namesp ret := _m.Called(ctx, namespace) var r0 *v1alpha1.SubscriptionList + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*v1alpha1.SubscriptionList, error)); ok { + return rf(ctx, namespace) + } if rf, ok := ret.Get(0).(func(context.Context, string) *v1alpha1.SubscriptionList); ok { r0 = rf(ctx, namespace) } else { @@ -609,7 +679,6 @@ func (_m *MockKubeClientConnector) ListSubscriptions(ctx context.Context, namesp } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, namespace) } else { @@ -624,6 +693,10 @@ func (_m *MockKubeClientConnector) UpdateInstallPlan(ctx context.Context, namesp ret := _m.Called(ctx, namespace, installPlan) var r0 *v1alpha1.InstallPlan + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, *v1alpha1.InstallPlan) (*v1alpha1.InstallPlan, error)); ok { + return rf(ctx, namespace, installPlan) + } if rf, ok := ret.Get(0).(func(context.Context, string, *v1alpha1.InstallPlan) *v1alpha1.InstallPlan); ok { r0 = rf(ctx, namespace, installPlan) } else { @@ -632,7 +705,6 @@ func (_m *MockKubeClientConnector) UpdateInstallPlan(ctx context.Context, namesp } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, *v1alpha1.InstallPlan) error); ok { r1 = rf(ctx, namespace, installPlan) } else { @@ -641,3 +713,18 @@ func (_m *MockKubeClientConnector) UpdateInstallPlan(ctx context.Context, namesp return r0, r1 } + +// NewMockKubeClientConnector creates a new instance of MockKubeClientConnector. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockKubeClientConnector(t interface { + mock.TestingT + Cleanup(func()) +}, +) *MockKubeClientConnector { + mock := &MockKubeClientConnector{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/grafana/deps.go b/managed/services/grafana/deps.go index 80174df7fa..e58ce85e8b 100644 --- a/managed/services/grafana/deps.go +++ b/managed/services/grafana/deps.go @@ -15,7 +15,7 @@ package grafana -//go:generate ../../../bin/mockery -name=awsInstanceChecker -case=snake -inpkg -testonly +//go:generate ../../../bin/mockery --name=awsInstanceChecker --case=snake --inpackage --testonly // checker is a subset of methods of server.AWSInstanceChecker used by this package. // We use it instead of real type for testing and to avoid dependency cycle. diff --git a/managed/services/grafana/mock_aws_instance_checker_test.go b/managed/services/grafana/mock_aws_instance_checker_test.go index a639c9b3f6..c9e02a0897 100644 --- a/managed/services/grafana/mock_aws_instance_checker_test.go +++ b/managed/services/grafana/mock_aws_instance_checker_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package grafana @@ -22,3 +22,18 @@ func (_m *mockAwsInstanceChecker) MustCheck() bool { return r0 } + +// newMockAwsInstanceChecker creates a new instance of mockAwsInstanceChecker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockAwsInstanceChecker(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockAwsInstanceChecker { + mock := &mockAwsInstanceChecker{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/inventory/deps.go b/managed/services/inventory/deps.go index b00c9d8734..a1471ea79c 100644 --- a/managed/services/inventory/deps.go +++ b/managed/services/inventory/deps.go @@ -23,13 +23,13 @@ import ( "github.com/percona/pmm/managed/models" ) -//go:generate ../../../bin/mockery -name=agentsRegistry -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=agentService -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=agentsStateUpdater -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=prometheusService -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=connectionChecker -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=versionCache -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=inventoryMetrics -case=snake -inpkg -testonly +//go:generate ../../../bin/mockery --name=agentsRegistry --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=agentService --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=agentsStateUpdater --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=prometheusService --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=connectionChecker --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=versionCache --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=inventoryMetrics --case=snake --inpackage --testonly // agentsRegistry is a subset of methods of agents.Registry used by this package. // We use it instead of real type for testing and to avoid dependency cycle. diff --git a/managed/services/inventory/mock_agent_service_test.go b/managed/services/inventory/mock_agent_service_test.go index 6b6fe42fcd..e5cb5c31a8 100644 --- a/managed/services/inventory/mock_agent_service_test.go +++ b/managed/services/inventory/mock_agent_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package inventory @@ -18,6 +18,11 @@ func (_m *mockAgentService) Logs(ctx context.Context, pmmAgentID string, agentID ret := _m.Called(ctx, pmmAgentID, agentID, limit) var r0 []string + var r1 uint32 + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, uint32) ([]string, uint32, error)); ok { + return rf(ctx, pmmAgentID, agentID, limit) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, uint32) []string); ok { r0 = rf(ctx, pmmAgentID, agentID, limit) } else { @@ -26,14 +31,12 @@ func (_m *mockAgentService) Logs(ctx context.Context, pmmAgentID string, agentID } } - var r1 uint32 if rf, ok := ret.Get(1).(func(context.Context, string, string, uint32) uint32); ok { r1 = rf(ctx, pmmAgentID, agentID, limit) } else { r1 = ret.Get(1).(uint32) } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, string, string, uint32) error); ok { r2 = rf(ctx, pmmAgentID, agentID, limit) } else { @@ -42,3 +45,18 @@ func (_m *mockAgentService) Logs(ctx context.Context, pmmAgentID string, agentID return r0, r1, r2 } + +// newMockAgentService creates a new instance of mockAgentService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockAgentService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockAgentService { + mock := &mockAgentService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/inventory/mock_agents_registry_test.go b/managed/services/inventory/mock_agents_registry_test.go index 2f3f6d6962..17d3609ad1 100644 --- a/managed/services/inventory/mock_agents_registry_test.go +++ b/managed/services/inventory/mock_agents_registry_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package inventory @@ -31,3 +31,18 @@ func (_m *mockAgentsRegistry) IsConnected(pmmAgentID string) bool { func (_m *mockAgentsRegistry) Kick(ctx context.Context, pmmAgentID string) { _m.Called(ctx, pmmAgentID) } + +// newMockAgentsRegistry creates a new instance of mockAgentsRegistry. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockAgentsRegistry(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockAgentsRegistry { + mock := &mockAgentsRegistry{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/inventory/mock_agents_state_updater_test.go b/managed/services/inventory/mock_agents_state_updater_test.go index e24e2ecbf7..a073d3ee25 100644 --- a/managed/services/inventory/mock_agents_state_updater_test.go +++ b/managed/services/inventory/mock_agents_state_updater_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package inventory @@ -17,3 +17,18 @@ type mockAgentsStateUpdater struct { func (_m *mockAgentsStateUpdater) RequestStateUpdate(ctx context.Context, pmmAgentID string) { _m.Called(ctx, pmmAgentID) } + +// newMockAgentsStateUpdater creates a new instance of mockAgentsStateUpdater. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockAgentsStateUpdater(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockAgentsStateUpdater { + mock := &mockAgentsStateUpdater{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/inventory/mock_connection_checker_test.go b/managed/services/inventory/mock_connection_checker_test.go index 566658670e..fca0ffe2da 100644 --- a/managed/services/inventory/mock_connection_checker_test.go +++ b/managed/services/inventory/mock_connection_checker_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package inventory @@ -29,3 +29,18 @@ func (_m *mockConnectionChecker) CheckConnectionToService(ctx context.Context, q return r0 } + +// newMockConnectionChecker creates a new instance of mockConnectionChecker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockConnectionChecker(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockConnectionChecker { + mock := &mockConnectionChecker{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/inventory/mock_inventory_metrics_test.go b/managed/services/inventory/mock_inventory_metrics_test.go index 2f0154ea20..55e461e1cb 100644 --- a/managed/services/inventory/mock_inventory_metrics_test.go +++ b/managed/services/inventory/mock_inventory_metrics_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package inventory @@ -18,6 +18,10 @@ func (_m *mockInventoryMetrics) GetAgentMetrics(ctx context.Context) ([]Metric, ret := _m.Called(ctx) var r0 []Metric + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) ([]Metric, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) []Metric); ok { r0 = rf(ctx) } else { @@ -26,7 +30,6 @@ func (_m *mockInventoryMetrics) GetAgentMetrics(ctx context.Context) ([]Metric, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -41,6 +44,10 @@ func (_m *mockInventoryMetrics) GetNodeMetrics(ctx context.Context) ([]Metric, e ret := _m.Called(ctx) var r0 []Metric + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) ([]Metric, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) []Metric); ok { r0 = rf(ctx) } else { @@ -49,7 +56,6 @@ func (_m *mockInventoryMetrics) GetNodeMetrics(ctx context.Context) ([]Metric, e } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -64,6 +70,10 @@ func (_m *mockInventoryMetrics) GetServiceMetrics(ctx context.Context) ([]Metric ret := _m.Called(ctx) var r0 []Metric + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) ([]Metric, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) []Metric); ok { r0 = rf(ctx) } else { @@ -72,7 +82,6 @@ func (_m *mockInventoryMetrics) GetServiceMetrics(ctx context.Context) ([]Metric } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -81,3 +90,18 @@ func (_m *mockInventoryMetrics) GetServiceMetrics(ctx context.Context) ([]Metric return r0, r1 } + +// newMockInventoryMetrics creates a new instance of mockInventoryMetrics. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockInventoryMetrics(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockInventoryMetrics { + mock := &mockInventoryMetrics{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/inventory/mock_prometheus_service_test.go b/managed/services/inventory/mock_prometheus_service_test.go index 5e66ff6898..03d2770440 100644 --- a/managed/services/inventory/mock_prometheus_service_test.go +++ b/managed/services/inventory/mock_prometheus_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package inventory @@ -13,3 +13,18 @@ type mockPrometheusService struct { func (_m *mockPrometheusService) RequestConfigurationUpdate() { _m.Called() } + +// newMockPrometheusService creates a new instance of mockPrometheusService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockPrometheusService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockPrometheusService { + mock := &mockPrometheusService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/inventory/mock_version_cache_test.go b/managed/services/inventory/mock_version_cache_test.go index 4c34901cad..141a110d5f 100644 --- a/managed/services/inventory/mock_version_cache_test.go +++ b/managed/services/inventory/mock_version_cache_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package inventory @@ -13,3 +13,18 @@ type mockVersionCache struct { func (_m *mockVersionCache) RequestSoftwareVersionsUpdate() { _m.Called() } + +// newMockVersionCache creates a new instance of mockVersionCache. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockVersionCache(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockVersionCache { + mock := &mockVersionCache{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/alerting/deps.go b/managed/services/management/alerting/deps.go index df8fbdd553..6b21b5387c 100644 --- a/managed/services/management/alerting/deps.go +++ b/managed/services/management/alerting/deps.go @@ -23,7 +23,7 @@ import ( "github.com/percona/pmm/managed/services" ) -//go:generate ../../../../bin/mockery -name=grafanaClient -case=snake -inpkg -testonly +//go:generate ../../../../bin/mockery --name=grafanaClient --case=snake --inpackage --testonly type grafanaClient interface { CreateAlertRule(ctx context.Context, folderName, groupName string, rule *services.Rule) error diff --git a/managed/services/management/alerting/mock_grafana_client_test.go b/managed/services/management/alerting/mock_grafana_client_test.go index 79a714c9ec..917915019c 100644 --- a/managed/services/management/alerting/mock_grafana_client_test.go +++ b/managed/services/management/alerting/mock_grafana_client_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package alerting @@ -35,13 +35,16 @@ func (_m *mockGrafanaClient) GetDatasourceUIDByID(ctx context.Context, id int64) ret := _m.Called(ctx, id) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, int64) (string, error)); ok { + return rf(ctx, id) + } if rf, ok := ret.Get(0).(func(context.Context, int64) string); ok { r0 = rf(ctx, id) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok { r1 = rf(ctx, id) } else { @@ -56,6 +59,10 @@ func (_m *mockGrafanaClient) GetFolderByUID(ctx context.Context, uid string) (*g ret := _m.Called(ctx, uid) var r0 *gapi.Folder + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*gapi.Folder, error)); ok { + return rf(ctx, uid) + } if rf, ok := ret.Get(0).(func(context.Context, string) *gapi.Folder); ok { r0 = rf(ctx, uid) } else { @@ -64,7 +71,6 @@ func (_m *mockGrafanaClient) GetFolderByUID(ctx context.Context, uid string) (*g } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, uid) } else { @@ -73,3 +79,18 @@ func (_m *mockGrafanaClient) GetFolderByUID(ctx context.Context, uid string) (*g return r0, r1 } + +// newMockGrafanaClient creates a new instance of mockGrafanaClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockGrafanaClient(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockGrafanaClient { + mock := &mockGrafanaClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/backup/deps.go b/managed/services/management/backup/deps.go index a7b660c6ba..5b8b794122 100644 --- a/managed/services/management/backup/deps.go +++ b/managed/services/management/backup/deps.go @@ -24,11 +24,11 @@ import ( "github.com/percona/pmm/managed/services/scheduler" ) -//go:generate ../../../../bin/mockery -name=awsS3 -case=snake -inpkg -testonly -//go:generate ../../../../bin/mockery -name=backupService -case=snake -inpkg -testonly -//go:generate ../../../../bin/mockery -name=scheduleService -case=snake -inpkg -testonly -//go:generate ../../../../bin/mockery -name=removalService -case=snake -inpkg -testonly -//go:generate ../../../../bin/mockery -name=pbmPITRService -case=snake -inpkg -testonly +//go:generate ../../../../bin/mockery --name=awsS3 --case=snake --inpackage --testonly +//go:generate ../../../../bin/mockery --name=backupService --case=snake --inpackage --testonly +//go:generate ../../../../bin/mockery --name=scheduleService --case=snake --inpackage --testonly +//go:generate ../../../../bin/mockery --name=removalService --case=snake --inpackage --testonly +//go:generate ../../../../bin/mockery --name=pbmPITRService --case=snake --inpackage --testonly type awsS3 interface { GetBucketLocation(ctx context.Context, host string, accessKey, secretKey, name string) (string, error) diff --git a/managed/services/management/backup/mock_aws_s3_test.go b/managed/services/management/backup/mock_aws_s3_test.go index a148e76abd..967f65a60a 100644 --- a/managed/services/management/backup/mock_aws_s3_test.go +++ b/managed/services/management/backup/mock_aws_s3_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package backup @@ -18,13 +18,16 @@ func (_m *mockAwsS3) BucketExists(ctx context.Context, host string, accessKey st ret := _m.Called(ctx, host, accessKey, secretKey, name) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string) (bool, error)); ok { + return rf(ctx, host, accessKey, secretKey, name) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string) bool); ok { r0 = rf(ctx, host, accessKey, secretKey, name) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string) error); ok { r1 = rf(ctx, host, accessKey, secretKey, name) } else { @@ -39,13 +42,16 @@ func (_m *mockAwsS3) GetBucketLocation(ctx context.Context, host string, accessK ret := _m.Called(ctx, host, accessKey, secretKey, name) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string) (string, error)); ok { + return rf(ctx, host, accessKey, secretKey, name) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string) string); ok { r0 = rf(ctx, host, accessKey, secretKey, name) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string) error); ok { r1 = rf(ctx, host, accessKey, secretKey, name) } else { @@ -68,3 +74,18 @@ func (_m *mockAwsS3) RemoveRecursive(ctx context.Context, endpoint string, acces return r0 } + +// newMockAwsS3 creates a new instance of mockAwsS3. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockAwsS3(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockAwsS3 { + mock := &mockAwsS3{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/backup/mock_backup_service_test.go b/managed/services/management/backup/mock_backup_service_test.go index a7df318ba1..e48d837367 100644 --- a/managed/services/management/backup/mock_backup_service_test.go +++ b/managed/services/management/backup/mock_backup_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package backup @@ -8,7 +8,7 @@ import ( mock "github.com/stretchr/testify/mock" - "github.com/percona/pmm/managed/services/backup" + servicesbackup "github.com/percona/pmm/managed/services/backup" ) // mockBackupService is an autogenerated mock type for the backupService type @@ -17,18 +17,21 @@ type mockBackupService struct { } // PerformBackup provides a mock function with given fields: ctx, params -func (_m *mockBackupService) PerformBackup(ctx context.Context, params backup.PerformBackupParams) (string, error) { +func (_m *mockBackupService) PerformBackup(ctx context.Context, params servicesbackup.PerformBackupParams) (string, error) { ret := _m.Called(ctx, params) var r0 string - if rf, ok := ret.Get(0).(func(context.Context, backup.PerformBackupParams) string); ok { + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, servicesbackup.PerformBackupParams) (string, error)); ok { + return rf(ctx, params) + } + if rf, ok := ret.Get(0).(func(context.Context, servicesbackup.PerformBackupParams) string); ok { r0 = rf(ctx, params) } else { r0 = ret.Get(0).(string) } - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, backup.PerformBackupParams) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, servicesbackup.PerformBackupParams) error); ok { r1 = rf(ctx, params) } else { r1 = ret.Error(1) @@ -42,13 +45,16 @@ func (_m *mockBackupService) RestoreBackup(ctx context.Context, serviceID string ret := _m.Called(ctx, serviceID, artifactID, pitrTimestamp) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, time.Time) (string, error)); ok { + return rf(ctx, serviceID, artifactID, pitrTimestamp) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, time.Time) string); ok { r0 = rf(ctx, serviceID, artifactID, pitrTimestamp) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, time.Time) error); ok { r1 = rf(ctx, serviceID, artifactID, pitrTimestamp) } else { @@ -71,3 +77,18 @@ func (_m *mockBackupService) SwitchMongoPITR(ctx context.Context, serviceID stri return r0 } + +// newMockBackupService creates a new instance of mockBackupService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockBackupService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockBackupService { + mock := &mockBackupService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/backup/mock_pbm_pitr_service_test.go b/managed/services/management/backup/mock_pbm_pitr_service_test.go index 93592d44b3..0200781289 100644 --- a/managed/services/management/backup/mock_pbm_pitr_service_test.go +++ b/managed/services/management/backup/mock_pbm_pitr_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package backup @@ -8,7 +8,7 @@ import ( mock "github.com/stretchr/testify/mock" models "github.com/percona/pmm/managed/models" - "github.com/percona/pmm/managed/services/backup" + servicesbackup "github.com/percona/pmm/managed/services/backup" ) // mockPbmPITRService is an autogenerated mock type for the pbmPITRService type @@ -17,20 +17,23 @@ type mockPbmPITRService struct { } // ListPITRTimeranges provides a mock function with given fields: ctx, locationClient, location, artifact -func (_m *mockPbmPITRService) ListPITRTimeranges(ctx context.Context, locationClient backup.Storage, location *models.BackupLocation, artifact *models.Artifact) ([]backup.Timeline, error) { +func (_m *mockPbmPITRService) ListPITRTimeranges(ctx context.Context, locationClient servicesbackup.Storage, location *models.BackupLocation, artifact *models.Artifact) ([]servicesbackup.Timeline, error) { ret := _m.Called(ctx, locationClient, location, artifact) - var r0 []backup.Timeline - if rf, ok := ret.Get(0).(func(context.Context, backup.Storage, *models.BackupLocation, *models.Artifact) []backup.Timeline); ok { + var r0 []servicesbackup.Timeline + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, servicesbackup.Storage, *models.BackupLocation, *models.Artifact) ([]servicesbackup.Timeline, error)); ok { + return rf(ctx, locationClient, location, artifact) + } + if rf, ok := ret.Get(0).(func(context.Context, servicesbackup.Storage, *models.BackupLocation, *models.Artifact) []servicesbackup.Timeline); ok { r0 = rf(ctx, locationClient, location, artifact) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]backup.Timeline) + r0 = ret.Get(0).([]servicesbackup.Timeline) } } - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, backup.Storage, *models.BackupLocation, *models.Artifact) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, servicesbackup.Storage, *models.BackupLocation, *models.Artifact) error); ok { r1 = rf(ctx, locationClient, location, artifact) } else { r1 = ret.Error(1) @@ -38,3 +41,18 @@ func (_m *mockPbmPITRService) ListPITRTimeranges(ctx context.Context, locationCl return r0, r1 } + +// newMockPbmPITRService creates a new instance of mockPbmPITRService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockPbmPITRService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockPbmPITRService { + mock := &mockPbmPITRService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/backup/mock_removal_service_test.go b/managed/services/management/backup/mock_removal_service_test.go index 75fc429d12..220e042193 100644 --- a/managed/services/management/backup/mock_removal_service_test.go +++ b/managed/services/management/backup/mock_removal_service_test.go @@ -1,11 +1,11 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package backup import ( mock "github.com/stretchr/testify/mock" - "github.com/percona/pmm/managed/services/backup" + servicesbackup "github.com/percona/pmm/managed/services/backup" ) // mockRemovalService is an autogenerated mock type for the removalService type @@ -14,11 +14,11 @@ type mockRemovalService struct { } // DeleteArtifact provides a mock function with given fields: storage, artifactID, removeFiles -func (_m *mockRemovalService) DeleteArtifact(storage backup.Storage, artifactID string, removeFiles bool) error { +func (_m *mockRemovalService) DeleteArtifact(storage servicesbackup.Storage, artifactID string, removeFiles bool) error { ret := _m.Called(storage, artifactID, removeFiles) var r0 error - if rf, ok := ret.Get(0).(func(backup.Storage, string, bool) error); ok { + if rf, ok := ret.Get(0).(func(servicesbackup.Storage, string, bool) error); ok { r0 = rf(storage, artifactID, removeFiles) } else { r0 = ret.Error(0) @@ -26,3 +26,18 @@ func (_m *mockRemovalService) DeleteArtifact(storage backup.Storage, artifactID return r0 } + +// newMockRemovalService creates a new instance of mockRemovalService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockRemovalService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockRemovalService { + mock := &mockRemovalService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/backup/mock_schedule_service_test.go b/managed/services/management/backup/mock_schedule_service_test.go index 748208bdef..21c17c231b 100644 --- a/managed/services/management/backup/mock_schedule_service_test.go +++ b/managed/services/management/backup/mock_schedule_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package backup @@ -21,6 +21,10 @@ func (_m *mockScheduleService) Add(task scheduler.Task, params scheduler.AddPara ret := _m.Called(task, params) var r0 *models.ScheduledTask + var r1 error + if rf, ok := ret.Get(0).(func(scheduler.Task, scheduler.AddParams) (*models.ScheduledTask, error)); ok { + return rf(task, params) + } if rf, ok := ret.Get(0).(func(scheduler.Task, scheduler.AddParams) *models.ScheduledTask); ok { r0 = rf(task, params) } else { @@ -29,7 +33,6 @@ func (_m *mockScheduleService) Add(task scheduler.Task, params scheduler.AddPara } } - var r1 error if rf, ok := ret.Get(1).(func(scheduler.Task, scheduler.AddParams) error); ok { r1 = rf(task, params) } else { @@ -71,3 +74,18 @@ func (_m *mockScheduleService) Update(id string, params models.ChangeScheduledTa return r0 } + +// newMockScheduleService creates a new instance of mockScheduleService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockScheduleService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockScheduleService { + mock := &mockScheduleService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/dbaas/deps.go b/managed/services/management/dbaas/deps.go index eee5bdffd5..84509c0236 100644 --- a/managed/services/management/dbaas/deps.go +++ b/managed/services/management/dbaas/deps.go @@ -34,12 +34,12 @@ import ( "github.com/percona/pmm/managed/services/dbaas/kubernetes" ) -//go:generate ../../../../bin/mockery -name=dbaasClient -case=snake -inpkg -testonly -//go:generate ../../../../bin/mockery -name=versionService -case=snake -inpkg -testonly -//go:generate ../../../../bin/mockery -name=grafanaClient -case=snake -inpkg -testonly -//go:generate ../../../../bin/mockery -name=componentsService -case=snake -inpkg -testonly -//go:generate ../../../../bin/mockery -name=kubernetesClient -case=snake -inpkg -testonly -//go:generate ../../../../bin/mockery -name=kubeStorageManager -case=snake -inpkg -testonly +//go:generate ../../../../bin/mockery --name=dbaasClient --case=snake --inpackage --testonly +//go:generate ../../../../bin/mockery --name=versionService --case=snake --inpackage --testonly +//go:generate ../../../../bin/mockery --name=grafanaClient --case=snake --inpackage --testonly +//go:generate ../../../../bin/mockery --name=componentsService --case=snake --inpackage --testonly +//go:generate ../../../../bin/mockery --name=kubernetesClient --case=snake --inpackage --testonly +//go:generate ../../../../bin/mockery --name=kubeStorageManager --case=snake --inpackage --testonly type dbaasClient interface { // Connect connects the client to dbaas-controller API. diff --git a/managed/services/management/dbaas/mock_components_service_test.go b/managed/services/management/dbaas/mock_components_service_test.go index 1baf299e3b..4e8c1662a6 100644 --- a/managed/services/management/dbaas/mock_components_service_test.go +++ b/managed/services/management/dbaas/mock_components_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package dbaas @@ -20,6 +20,10 @@ func (_m *mockComponentsService) ChangePSMDBComponents(_a0 context.Context, _a1 ret := _m.Called(_a0, _a1) var r0 *dbaasv1beta1.ChangePSMDBComponentsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.ChangePSMDBComponentsRequest) (*dbaasv1beta1.ChangePSMDBComponentsResponse, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.ChangePSMDBComponentsRequest) *dbaasv1beta1.ChangePSMDBComponentsResponse); ok { r0 = rf(_a0, _a1) } else { @@ -28,7 +32,6 @@ func (_m *mockComponentsService) ChangePSMDBComponents(_a0 context.Context, _a1 } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *dbaasv1beta1.ChangePSMDBComponentsRequest) error); ok { r1 = rf(_a0, _a1) } else { @@ -43,6 +46,10 @@ func (_m *mockComponentsService) ChangePXCComponents(_a0 context.Context, _a1 *d ret := _m.Called(_a0, _a1) var r0 *dbaasv1beta1.ChangePXCComponentsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.ChangePXCComponentsRequest) (*dbaasv1beta1.ChangePXCComponentsResponse, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.ChangePXCComponentsRequest) *dbaasv1beta1.ChangePXCComponentsResponse); ok { r0 = rf(_a0, _a1) } else { @@ -51,7 +58,6 @@ func (_m *mockComponentsService) ChangePXCComponents(_a0 context.Context, _a1 *d } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *dbaasv1beta1.ChangePXCComponentsRequest) error); ok { r1 = rf(_a0, _a1) } else { @@ -66,6 +72,10 @@ func (_m *mockComponentsService) CheckForOperatorUpdate(_a0 context.Context, _a1 ret := _m.Called(_a0, _a1) var r0 *dbaasv1beta1.CheckForOperatorUpdateResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.CheckForOperatorUpdateRequest) (*dbaasv1beta1.CheckForOperatorUpdateResponse, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.CheckForOperatorUpdateRequest) *dbaasv1beta1.CheckForOperatorUpdateResponse); ok { r0 = rf(_a0, _a1) } else { @@ -74,7 +84,6 @@ func (_m *mockComponentsService) CheckForOperatorUpdate(_a0 context.Context, _a1 } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *dbaasv1beta1.CheckForOperatorUpdateRequest) error); ok { r1 = rf(_a0, _a1) } else { @@ -89,6 +98,10 @@ func (_m *mockComponentsService) GetPSMDBComponents(_a0 context.Context, _a1 *db ret := _m.Called(_a0, _a1) var r0 *dbaasv1beta1.GetPSMDBComponentsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.GetPSMDBComponentsRequest) (*dbaasv1beta1.GetPSMDBComponentsResponse, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.GetPSMDBComponentsRequest) *dbaasv1beta1.GetPSMDBComponentsResponse); ok { r0 = rf(_a0, _a1) } else { @@ -97,7 +110,6 @@ func (_m *mockComponentsService) GetPSMDBComponents(_a0 context.Context, _a1 *db } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *dbaasv1beta1.GetPSMDBComponentsRequest) error); ok { r1 = rf(_a0, _a1) } else { @@ -112,6 +124,10 @@ func (_m *mockComponentsService) GetPXCComponents(_a0 context.Context, _a1 *dbaa ret := _m.Called(_a0, _a1) var r0 *dbaasv1beta1.GetPXCComponentsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.GetPXCComponentsRequest) (*dbaasv1beta1.GetPXCComponentsResponse, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.GetPXCComponentsRequest) *dbaasv1beta1.GetPXCComponentsResponse); ok { r0 = rf(_a0, _a1) } else { @@ -120,7 +136,6 @@ func (_m *mockComponentsService) GetPXCComponents(_a0 context.Context, _a1 *dbaa } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *dbaasv1beta1.GetPXCComponentsRequest) error); ok { r1 = rf(_a0, _a1) } else { @@ -135,6 +150,10 @@ func (_m *mockComponentsService) InstallOperator(_a0 context.Context, _a1 *dbaas ret := _m.Called(_a0, _a1) var r0 *dbaasv1beta1.InstallOperatorResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.InstallOperatorRequest) (*dbaasv1beta1.InstallOperatorResponse, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *dbaasv1beta1.InstallOperatorRequest) *dbaasv1beta1.InstallOperatorResponse); ok { r0 = rf(_a0, _a1) } else { @@ -143,7 +162,6 @@ func (_m *mockComponentsService) InstallOperator(_a0 context.Context, _a1 *dbaas } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *dbaasv1beta1.InstallOperatorRequest) error); ok { r1 = rf(_a0, _a1) } else { @@ -152,3 +170,18 @@ func (_m *mockComponentsService) InstallOperator(_a0 context.Context, _a1 *dbaas return r0, r1 } + +// newMockComponentsService creates a new instance of mockComponentsService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockComponentsService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockComponentsService { + mock := &mockComponentsService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/dbaas/mock_dbaas_client_test.go b/managed/services/management/dbaas/mock_dbaas_client_test.go index 6d7ba8c3d6..6908f7c2c4 100644 --- a/managed/services/management/dbaas/mock_dbaas_client_test.go +++ b/managed/services/management/dbaas/mock_dbaas_client_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package dbaas @@ -55,6 +55,10 @@ func (_m *mockDbaasClient) GetKubeConfig(ctx context.Context, in *controllerv1be ret := _m.Called(_ca...) var r0 *controllerv1beta1.GetKubeconfigResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.GetKubeconfigRequest, ...grpc.CallOption) (*controllerv1beta1.GetKubeconfigResponse, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.GetKubeconfigRequest, ...grpc.CallOption) *controllerv1beta1.GetKubeconfigResponse); ok { r0 = rf(ctx, in, opts...) } else { @@ -63,7 +67,6 @@ func (_m *mockDbaasClient) GetKubeConfig(ctx context.Context, in *controllerv1be } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *controllerv1beta1.GetKubeconfigRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -85,6 +88,10 @@ func (_m *mockDbaasClient) GetLogs(ctx context.Context, in *controllerv1beta1.Ge ret := _m.Called(_ca...) var r0 *controllerv1beta1.GetLogsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.GetLogsRequest, ...grpc.CallOption) (*controllerv1beta1.GetLogsResponse, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.GetLogsRequest, ...grpc.CallOption) *controllerv1beta1.GetLogsResponse); ok { r0 = rf(ctx, in, opts...) } else { @@ -93,7 +100,6 @@ func (_m *mockDbaasClient) GetLogs(ctx context.Context, in *controllerv1beta1.Ge } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *controllerv1beta1.GetLogsRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -115,6 +121,10 @@ func (_m *mockDbaasClient) GetResources(ctx context.Context, in *controllerv1bet ret := _m.Called(_ca...) var r0 *controllerv1beta1.GetResourcesResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.GetResourcesRequest, ...grpc.CallOption) (*controllerv1beta1.GetResourcesResponse, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.GetResourcesRequest, ...grpc.CallOption) *controllerv1beta1.GetResourcesResponse); ok { r0 = rf(ctx, in, opts...) } else { @@ -123,7 +133,6 @@ func (_m *mockDbaasClient) GetResources(ctx context.Context, in *controllerv1bet } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *controllerv1beta1.GetResourcesRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -145,6 +154,10 @@ func (_m *mockDbaasClient) InstallPSMDBOperator(ctx context.Context, in *control ret := _m.Called(_ca...) var r0 *controllerv1beta1.InstallPSMDBOperatorResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.InstallPSMDBOperatorRequest, ...grpc.CallOption) (*controllerv1beta1.InstallPSMDBOperatorResponse, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.InstallPSMDBOperatorRequest, ...grpc.CallOption) *controllerv1beta1.InstallPSMDBOperatorResponse); ok { r0 = rf(ctx, in, opts...) } else { @@ -153,7 +166,6 @@ func (_m *mockDbaasClient) InstallPSMDBOperator(ctx context.Context, in *control } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *controllerv1beta1.InstallPSMDBOperatorRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -175,6 +187,10 @@ func (_m *mockDbaasClient) InstallPXCOperator(ctx context.Context, in *controlle ret := _m.Called(_ca...) var r0 *controllerv1beta1.InstallPXCOperatorResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.InstallPXCOperatorRequest, ...grpc.CallOption) (*controllerv1beta1.InstallPXCOperatorResponse, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.InstallPXCOperatorRequest, ...grpc.CallOption) *controllerv1beta1.InstallPXCOperatorResponse); ok { r0 = rf(ctx, in, opts...) } else { @@ -183,7 +199,6 @@ func (_m *mockDbaasClient) InstallPXCOperator(ctx context.Context, in *controlle } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *controllerv1beta1.InstallPXCOperatorRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -205,6 +220,10 @@ func (_m *mockDbaasClient) StartMonitoring(ctx context.Context, in *controllerv1 ret := _m.Called(_ca...) var r0 *controllerv1beta1.StartMonitoringResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.StartMonitoringRequest, ...grpc.CallOption) (*controllerv1beta1.StartMonitoringResponse, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.StartMonitoringRequest, ...grpc.CallOption) *controllerv1beta1.StartMonitoringResponse); ok { r0 = rf(ctx, in, opts...) } else { @@ -213,7 +232,6 @@ func (_m *mockDbaasClient) StartMonitoring(ctx context.Context, in *controllerv1 } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *controllerv1beta1.StartMonitoringRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -235,6 +253,10 @@ func (_m *mockDbaasClient) StopMonitoring(ctx context.Context, in *controllerv1b ret := _m.Called(_ca...) var r0 *controllerv1beta1.StopMonitoringResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.StopMonitoringRequest, ...grpc.CallOption) (*controllerv1beta1.StopMonitoringResponse, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *controllerv1beta1.StopMonitoringRequest, ...grpc.CallOption) *controllerv1beta1.StopMonitoringResponse); ok { r0 = rf(ctx, in, opts...) } else { @@ -243,7 +265,6 @@ func (_m *mockDbaasClient) StopMonitoring(ctx context.Context, in *controllerv1b } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *controllerv1beta1.StopMonitoringRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -252,3 +273,18 @@ func (_m *mockDbaasClient) StopMonitoring(ctx context.Context, in *controllerv1b return r0, r1 } + +// newMockDbaasClient creates a new instance of mockDbaasClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockDbaasClient(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockDbaasClient { + mock := &mockDbaasClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/dbaas/mock_grafana_client_test.go b/managed/services/management/dbaas/mock_grafana_client_test.go index d73e8c7574..c74aa84637 100644 --- a/managed/services/management/dbaas/mock_grafana_client_test.go +++ b/managed/services/management/dbaas/mock_grafana_client_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package dbaas @@ -18,20 +18,23 @@ func (_m *mockGrafanaClient) CreateAdminAPIKey(ctx context.Context, name string) ret := _m.Called(ctx, name) var r0 int64 + var r1 string + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, string) (int64, string, error)); ok { + return rf(ctx, name) + } if rf, ok := ret.Get(0).(func(context.Context, string) int64); ok { r0 = rf(ctx, name) } else { r0 = ret.Get(0).(int64) } - var r1 string if rf, ok := ret.Get(1).(func(context.Context, string) string); ok { r1 = rf(ctx, name) } else { r1 = ret.Get(1).(string) } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, string) error); ok { r2 = rf(ctx, name) } else { @@ -68,3 +71,18 @@ func (_m *mockGrafanaClient) DeleteAPIKeysWithPrefix(ctx context.Context, name s return r0 } + +// newMockGrafanaClient creates a new instance of mockGrafanaClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockGrafanaClient(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockGrafanaClient { + mock := &mockGrafanaClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/dbaas/mock_kube_storage_manager_test.go b/managed/services/management/dbaas/mock_kube_storage_manager_test.go index 2ed20dba85..e5f2f146a1 100644 --- a/managed/services/management/dbaas/mock_kube_storage_manager_test.go +++ b/managed/services/management/dbaas/mock_kube_storage_manager_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package dbaas @@ -28,6 +28,10 @@ func (_m *mockKubeStorageManager) GetOrSetClient(name string) (kubernetesClient, ret := _m.Called(name) var r0 kubernetesClient + var r1 error + if rf, ok := ret.Get(0).(func(string) (kubernetesClient, error)); ok { + return rf(name) + } if rf, ok := ret.Get(0).(func(string) kubernetesClient); ok { r0 = rf(name) } else { @@ -36,7 +40,6 @@ func (_m *mockKubeStorageManager) GetOrSetClient(name string) (kubernetesClient, } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(name) } else { @@ -45,3 +48,18 @@ func (_m *mockKubeStorageManager) GetOrSetClient(name string) (kubernetesClient, return r0, r1 } + +// newMockKubeStorageManager creates a new instance of mockKubeStorageManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockKubeStorageManager(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockKubeStorageManager { + mock := &mockKubeStorageManager{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/dbaas/mock_kubernetes_client_test.go b/managed/services/management/dbaas/mock_kubernetes_client_test.go index 0bbe76bfd9..2dd1b630f0 100644 --- a/managed/services/management/dbaas/mock_kubernetes_client_test.go +++ b/managed/services/management/dbaas/mock_kubernetes_client_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package dbaas @@ -82,27 +82,30 @@ func (_m *mockKubernetesClient) GetAllClusterResources(_a0 context.Context, _a1 ret := _m.Called(_a0, _a1, _a2) var r0 uint64 + var r1 uint64 + var r2 uint64 + var r3 error + if rf, ok := ret.Get(0).(func(context.Context, kubernetes.ClusterType, *corev1.PersistentVolumeList) (uint64, uint64, uint64, error)); ok { + return rf(_a0, _a1, _a2) + } if rf, ok := ret.Get(0).(func(context.Context, kubernetes.ClusterType, *corev1.PersistentVolumeList) uint64); ok { r0 = rf(_a0, _a1, _a2) } else { r0 = ret.Get(0).(uint64) } - var r1 uint64 if rf, ok := ret.Get(1).(func(context.Context, kubernetes.ClusterType, *corev1.PersistentVolumeList) uint64); ok { r1 = rf(_a0, _a1, _a2) } else { r1 = ret.Get(1).(uint64) } - var r2 uint64 if rf, ok := ret.Get(2).(func(context.Context, kubernetes.ClusterType, *corev1.PersistentVolumeList) uint64); ok { r2 = rf(_a0, _a1, _a2) } else { r2 = ret.Get(2).(uint64) } - var r3 error if rf, ok := ret.Get(3).(func(context.Context, kubernetes.ClusterType, *corev1.PersistentVolumeList) error); ok { r3 = rf(_a0, _a1, _a2) } else { @@ -117,13 +120,16 @@ func (_m *mockKubernetesClient) GetClusterType(_a0 context.Context) (kubernetes. ret := _m.Called(_a0) var r0 kubernetes.ClusterType + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (kubernetes.ClusterType, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) kubernetes.ClusterType); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(kubernetes.ClusterType) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -138,20 +144,23 @@ func (_m *mockKubernetesClient) GetConsumedCPUAndMemory(_a0 context.Context, _a1 ret := _m.Called(_a0, _a1) var r0 uint64 + var r1 uint64 + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, string) (uint64, uint64, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, string) uint64); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Get(0).(uint64) } - var r1 uint64 if rf, ok := ret.Get(1).(func(context.Context, string) uint64); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Get(1).(uint64) } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, string) error); ok { r2 = rf(_a0, _a1) } else { @@ -166,13 +175,16 @@ func (_m *mockKubernetesClient) GetConsumedDiskBytes(_a0 context.Context, _a1 ku ret := _m.Called(_a0, _a1, _a2) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, kubernetes.ClusterType, *corev1.PersistentVolumeList) (uint64, error)); ok { + return rf(_a0, _a1, _a2) + } if rf, ok := ret.Get(0).(func(context.Context, kubernetes.ClusterType, *corev1.PersistentVolumeList) uint64); ok { r0 = rf(_a0, _a1, _a2) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, kubernetes.ClusterType, *corev1.PersistentVolumeList) error); ok { r1 = rf(_a0, _a1, _a2) } else { @@ -187,6 +199,10 @@ func (_m *mockKubernetesClient) GetDatabaseCluster(_a0 context.Context, _a1 stri ret := _m.Called(_a0, _a1) var r0 *v1.DatabaseCluster + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*v1.DatabaseCluster, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, string) *v1.DatabaseCluster); ok { r0 = rf(_a0, _a1) } else { @@ -195,7 +211,6 @@ func (_m *mockKubernetesClient) GetDatabaseCluster(_a0 context.Context, _a1 stri } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(_a0, _a1) } else { @@ -210,13 +225,16 @@ func (_m *mockKubernetesClient) GetDefaultStorageClassName(_a0 context.Context) ret := _m.Called(_a0) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (string, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) string); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -231,13 +249,16 @@ func (_m *mockKubernetesClient) GetPSMDBOperatorVersion(_a0 context.Context) (st ret := _m.Called(_a0) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (string, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) string); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -252,13 +273,16 @@ func (_m *mockKubernetesClient) GetPXCOperatorVersion(_a0 context.Context) (stri ret := _m.Called(_a0) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (string, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) string); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -273,6 +297,10 @@ func (_m *mockKubernetesClient) GetPersistentVolumes(ctx context.Context) (*core ret := _m.Called(ctx) var r0 *corev1.PersistentVolumeList + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*corev1.PersistentVolumeList, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) *corev1.PersistentVolumeList); ok { r0 = rf(ctx) } else { @@ -281,7 +309,6 @@ func (_m *mockKubernetesClient) GetPersistentVolumes(ctx context.Context) (*core } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -296,6 +323,10 @@ func (_m *mockKubernetesClient) GetSecret(_a0 context.Context, _a1 string) (*cor ret := _m.Called(_a0, _a1) var r0 *corev1.Secret + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*corev1.Secret, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, string) *corev1.Secret); ok { r0 = rf(_a0, _a1) } else { @@ -304,7 +335,6 @@ func (_m *mockKubernetesClient) GetSecret(_a0 context.Context, _a1 string) (*cor } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(_a0, _a1) } else { @@ -319,6 +349,10 @@ func (_m *mockKubernetesClient) GetServerVersion() (*version.Info, error) { ret := _m.Called() var r0 *version.Info + var r1 error + if rf, ok := ret.Get(0).(func() (*version.Info, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() *version.Info); ok { r0 = rf() } else { @@ -327,7 +361,6 @@ func (_m *mockKubernetesClient) GetServerVersion() (*version.Info, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -342,6 +375,10 @@ func (_m *mockKubernetesClient) GetStorageClasses(ctx context.Context) (*storage ret := _m.Called(ctx) var r0 *storagev1.StorageClassList + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*storagev1.StorageClassList, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) *storagev1.StorageClassList); ok { r0 = rf(ctx) } else { @@ -350,7 +387,6 @@ func (_m *mockKubernetesClient) GetStorageClasses(ctx context.Context) (*storage } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -393,6 +429,10 @@ func (_m *mockKubernetesClient) ListDatabaseClusters(_a0 context.Context) (*v1.D ret := _m.Called(_a0) var r0 *v1.DatabaseClusterList + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*v1.DatabaseClusterList, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *v1.DatabaseClusterList); ok { r0 = rf(_a0) } else { @@ -401,7 +441,6 @@ func (_m *mockKubernetesClient) ListDatabaseClusters(_a0 context.Context) (*v1.D } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -416,6 +455,10 @@ func (_m *mockKubernetesClient) ListSecrets(_a0 context.Context) (*corev1.Secret ret := _m.Called(_a0) var r0 *corev1.SecretList + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*corev1.SecretList, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *corev1.SecretList); ok { r0 = rf(_a0) } else { @@ -424,7 +467,6 @@ func (_m *mockKubernetesClient) ListSecrets(_a0 context.Context) (*corev1.Secret } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -439,6 +481,10 @@ func (_m *mockKubernetesClient) ListSubscriptions(ctx context.Context, namespace ret := _m.Called(ctx, namespace) var r0 *v1alpha1.SubscriptionList + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*v1alpha1.SubscriptionList, error)); ok { + return rf(ctx, namespace) + } if rf, ok := ret.Get(0).(func(context.Context, string) *v1alpha1.SubscriptionList); ok { r0 = rf(ctx, namespace) } else { @@ -447,7 +493,6 @@ func (_m *mockKubernetesClient) ListSubscriptions(ctx context.Context, namespace } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, namespace) } else { @@ -462,6 +507,10 @@ func (_m *mockKubernetesClient) ListTemplates(ctx context.Context, engine string ret := _m.Called(ctx, engine, namespace) var r0 []*dbaasv1beta1.Template + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) ([]*dbaasv1beta1.Template, error)); ok { + return rf(ctx, engine, namespace) + } if rf, ok := ret.Get(0).(func(context.Context, string, string) []*dbaasv1beta1.Template); ok { r0 = rf(ctx, engine, namespace) } else { @@ -470,7 +519,6 @@ func (_m *mockKubernetesClient) ListTemplates(ctx context.Context, engine string } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { r1 = rf(ctx, engine, namespace) } else { @@ -535,3 +583,18 @@ func (_m *mockKubernetesClient) UpgradeOperator(ctx context.Context, namespace s return r0 } + +// newMockKubernetesClient creates a new instance of mockKubernetesClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockKubernetesClient(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockKubernetesClient { + mock := &mockKubernetesClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/dbaas/mock_version_service_test.go b/managed/services/management/dbaas/mock_version_service_test.go index edd67d1c45..b5da686a14 100644 --- a/managed/services/management/dbaas/mock_version_service_test.go +++ b/managed/services/management/dbaas/mock_version_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package dbaas @@ -19,13 +19,16 @@ func (_m *mockVersionService) GetNextDatabaseImage(ctx context.Context, operator ret := _m.Called(ctx, operatorType, operatorVersion, installedDBVersion) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) (string, error)); ok { + return rf(ctx, operatorType, operatorVersion, installedDBVersion) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string) string); ok { r0 = rf(ctx, operatorType, operatorVersion, installedDBVersion) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok { r1 = rf(ctx, operatorType, operatorVersion, installedDBVersion) } else { @@ -54,13 +57,16 @@ func (_m *mockVersionService) IsDatabaseVersionSupportedByOperator(ctx context.C ret := _m.Called(ctx, operatorType, operatorVersion, databaseVersion) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, string) (bool, error)); ok { + return rf(ctx, operatorType, operatorVersion, databaseVersion) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, string) bool); ok { r0 = rf(ctx, operatorType, operatorVersion, databaseVersion) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok { r1 = rf(ctx, operatorType, operatorVersion, databaseVersion) } else { @@ -75,6 +81,11 @@ func (_m *mockVersionService) LatestOperatorVersion(ctx context.Context, pmmVers ret := _m.Called(ctx, pmmVersion) var r0 *version.Version + var r1 *version.Version + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*version.Version, *version.Version, error)); ok { + return rf(ctx, pmmVersion) + } if rf, ok := ret.Get(0).(func(context.Context, string) *version.Version); ok { r0 = rf(ctx, pmmVersion) } else { @@ -83,7 +94,6 @@ func (_m *mockVersionService) LatestOperatorVersion(ctx context.Context, pmmVers } } - var r1 *version.Version if rf, ok := ret.Get(1).(func(context.Context, string) *version.Version); ok { r1 = rf(ctx, pmmVersion) } else { @@ -92,7 +102,6 @@ func (_m *mockVersionService) LatestOperatorVersion(ctx context.Context, pmmVers } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, string) error); ok { r2 = rf(ctx, pmmVersion) } else { @@ -107,6 +116,10 @@ func (_m *mockVersionService) Matrix(ctx context.Context, params componentsParam ret := _m.Called(ctx, params) var r0 *VersionServiceResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, componentsParams) (*VersionServiceResponse, error)); ok { + return rf(ctx, params) + } if rf, ok := ret.Get(0).(func(context.Context, componentsParams) *VersionServiceResponse); ok { r0 = rf(ctx, params) } else { @@ -115,7 +128,6 @@ func (_m *mockVersionService) Matrix(ctx context.Context, params componentsParam } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, componentsParams) error); ok { r1 = rf(ctx, params) } else { @@ -130,6 +142,10 @@ func (_m *mockVersionService) NextOperatorVersion(ctx context.Context, operatorT ret := _m.Called(ctx, operatorType, installedVersion) var r0 *version.Version + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) (*version.Version, error)); ok { + return rf(ctx, operatorType, installedVersion) + } if rf, ok := ret.Get(0).(func(context.Context, string, string) *version.Version); ok { r0 = rf(ctx, operatorType, installedVersion) } else { @@ -138,7 +154,6 @@ func (_m *mockVersionService) NextOperatorVersion(ctx context.Context, operatorT } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { r1 = rf(ctx, operatorType, installedVersion) } else { @@ -153,6 +168,10 @@ func (_m *mockVersionService) SupportedOperatorVersionsList(ctx context.Context, ret := _m.Called(ctx, pmmVersion) var r0 map[string][]string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (map[string][]string, error)); ok { + return rf(ctx, pmmVersion) + } if rf, ok := ret.Get(0).(func(context.Context, string) map[string][]string); ok { r0 = rf(ctx, pmmVersion) } else { @@ -161,7 +180,6 @@ func (_m *mockVersionService) SupportedOperatorVersionsList(ctx context.Context, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, pmmVersion) } else { @@ -170,3 +188,18 @@ func (_m *mockVersionService) SupportedOperatorVersionsList(ctx context.Context, return r0, r1 } + +// newMockVersionService creates a new instance of mockVersionService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockVersionService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockVersionService { + mock := &mockVersionService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/deps.go b/managed/services/management/deps.go index 1572d32c5a..1a873f89a4 100644 --- a/managed/services/management/deps.go +++ b/managed/services/management/deps.go @@ -28,15 +28,15 @@ import ( "github.com/percona/pmm/managed/services" ) -//go:generate ../../../bin/mockery -name=agentsRegistry -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=agentsStateUpdater -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=prometheusService -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=checksService -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=grafanaClient -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=jobsService -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=connectionChecker -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=versionCache -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=victoriaMetricsClient -case=snake -inpkg -testonly +//go:generate ../../../bin/mockery --name=agentsRegistry --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=agentsStateUpdater --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=prometheusService --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=checksService --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=grafanaClient --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=jobsService --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=connectionChecker --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=versionCache --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=victoriaMetricsClient --case=snake --inpackage --testonly // agentsRegistry is a subset of methods of agents.Registry used by this package. // We use it instead of real type for testing and to avoid dependency cycle. diff --git a/managed/services/management/ia/deps.go b/managed/services/management/ia/deps.go index b047152e00..12f19bc0a4 100644 --- a/managed/services/management/ia/deps.go +++ b/managed/services/management/ia/deps.go @@ -23,9 +23,9 @@ import ( "github.com/percona/pmm/managed/services/management/alerting" ) -//go:generate ../../../../bin/mockery -name=alertManager -case=snake -inpkg -testonly -//go:generate ../../../../bin/mockery -name=vmAlert -case=snake -inpkg -testonly -//go:generate ../../../../bin/mockery -name=templatesService -case=snake -inpkg -testonly +//go:generate ../../../../bin/mockery --name=alertManager --case=snake --inpackage --testonly +//go:generate ../../../../bin/mockery --name=vmAlert --case=snake --inpackage --testonly +//go:generate ../../../../bin/mockery --name=templatesService --case=snake --inpackage --testonly // alertManager is a subset of methods of alertmanager.Service used by this package. // We use it instead of real type for testing and to avoid dependency cycle. diff --git a/managed/services/management/ia/mock_alert_manager_test.go b/managed/services/management/ia/mock_alert_manager_test.go index 5832587b47..807ea6bb70 100644 --- a/managed/services/management/ia/mock_alert_manager_test.go +++ b/managed/services/management/ia/mock_alert_manager_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package ia @@ -21,6 +21,10 @@ func (_m *mockAlertManager) FindAlertsByID(ctx context.Context, params *services ret := _m.Called(ctx, params, ids) var r0 []*ammodels.GettableAlert + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *services.FilterParams, []string) ([]*ammodels.GettableAlert, error)); ok { + return rf(ctx, params, ids) + } if rf, ok := ret.Get(0).(func(context.Context, *services.FilterParams, []string) []*ammodels.GettableAlert); ok { r0 = rf(ctx, params, ids) } else { @@ -29,7 +33,6 @@ func (_m *mockAlertManager) FindAlertsByID(ctx context.Context, params *services } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *services.FilterParams, []string) error); ok { r1 = rf(ctx, params, ids) } else { @@ -44,6 +47,10 @@ func (_m *mockAlertManager) GetAlerts(ctx context.Context, params *services.Filt ret := _m.Called(ctx, params) var r0 []*ammodels.GettableAlert + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *services.FilterParams) ([]*ammodels.GettableAlert, error)); ok { + return rf(ctx, params) + } if rf, ok := ret.Get(0).(func(context.Context, *services.FilterParams) []*ammodels.GettableAlert); ok { r0 = rf(ctx, params) } else { @@ -52,7 +59,6 @@ func (_m *mockAlertManager) GetAlerts(ctx context.Context, params *services.Filt } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *services.FilterParams) error); ok { r1 = rf(ctx, params) } else { @@ -94,3 +100,18 @@ func (_m *mockAlertManager) UnsilenceAlerts(ctx context.Context, alerts []*ammod return r0 } + +// newMockAlertManager creates a new instance of mockAlertManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockAlertManager(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockAlertManager { + mock := &mockAlertManager{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/ia/mock_templates_service_test.go b/managed/services/management/ia/mock_templates_service_test.go index 6f1e68ad29..fd979a674c 100644 --- a/managed/services/management/ia/mock_templates_service_test.go +++ b/managed/services/management/ia/mock_templates_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package ia @@ -28,3 +28,18 @@ func (_m *mockTemplatesService) GetTemplates() map[string]alerting.TemplateInfo return r0 } + +// newMockTemplatesService creates a new instance of mockTemplatesService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockTemplatesService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockTemplatesService { + mock := &mockTemplatesService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/ia/mock_vm_alert_test.go b/managed/services/management/ia/mock_vm_alert_test.go index 83722527c7..f4d881db5e 100644 --- a/managed/services/management/ia/mock_vm_alert_test.go +++ b/managed/services/management/ia/mock_vm_alert_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package ia @@ -13,3 +13,18 @@ type mockVmAlert struct { func (_m *mockVmAlert) RequestConfigurationUpdate() { _m.Called() } + +// newMockVmAlert creates a new instance of mockVmAlert. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockVmAlert(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockVmAlert { + mock := &mockVmAlert{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/mock_agents_registry_test.go b/managed/services/management/mock_agents_registry_test.go index ea855f6147..0dbb0951da 100644 --- a/managed/services/management/mock_agents_registry_test.go +++ b/managed/services/management/mock_agents_registry_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package management @@ -31,3 +31,18 @@ func (_m *mockAgentsRegistry) IsConnected(pmmAgentID string) bool { func (_m *mockAgentsRegistry) Kick(ctx context.Context, pmmAgentID string) { _m.Called(ctx, pmmAgentID) } + +// newMockAgentsRegistry creates a new instance of mockAgentsRegistry. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockAgentsRegistry(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockAgentsRegistry { + mock := &mockAgentsRegistry{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/mock_agents_state_updater_test.go b/managed/services/management/mock_agents_state_updater_test.go index dc2bdc59a9..ce3b259251 100644 --- a/managed/services/management/mock_agents_state_updater_test.go +++ b/managed/services/management/mock_agents_state_updater_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package management @@ -17,3 +17,18 @@ type mockAgentsStateUpdater struct { func (_m *mockAgentsStateUpdater) RequestStateUpdate(ctx context.Context, pmmAgentID string) { _m.Called(ctx, pmmAgentID) } + +// newMockAgentsStateUpdater creates a new instance of mockAgentsStateUpdater. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockAgentsStateUpdater(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockAgentsStateUpdater { + mock := &mockAgentsStateUpdater{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/mock_api_key_provider_test.go b/managed/services/management/mock_api_key_provider_test.go index 21df427bc7..212d9665c4 100644 --- a/managed/services/management/mock_api_key_provider_test.go +++ b/managed/services/management/mock_api_key_provider_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package management @@ -18,20 +18,23 @@ func (_m *mockApiKeyProvider) CreateAdminAPIKey(ctx context.Context, name string ret := _m.Called(ctx, name) var r0 int64 + var r1 string + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, string) (int64, string, error)); ok { + return rf(ctx, name) + } if rf, ok := ret.Get(0).(func(context.Context, string) int64); ok { r0 = rf(ctx, name) } else { r0 = ret.Get(0).(int64) } - var r1 string if rf, ok := ret.Get(1).(func(context.Context, string) string); ok { r1 = rf(ctx, name) } else { r1 = ret.Get(1).(string) } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, string) error); ok { r2 = rf(ctx, name) } else { @@ -40,3 +43,18 @@ func (_m *mockApiKeyProvider) CreateAdminAPIKey(ctx context.Context, name string return r0, r1, r2 } + +// newMockApiKeyProvider creates a new instance of mockApiKeyProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockApiKeyProvider(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockApiKeyProvider { + mock := &mockApiKeyProvider{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/mock_checks_service_test.go b/managed/services/management/mock_checks_service_test.go index cbcd758983..b8e56ad71e 100644 --- a/managed/services/management/mock_checks_service_test.go +++ b/managed/services/management/mock_checks_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package management @@ -63,6 +63,10 @@ func (_m *mockChecksService) GetAdvisors() ([]check.Advisor, error) { ret := _m.Called() var r0 []check.Advisor + var r1 error + if rf, ok := ret.Get(0).(func() ([]check.Advisor, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []check.Advisor); ok { r0 = rf() } else { @@ -71,7 +75,6 @@ func (_m *mockChecksService) GetAdvisors() ([]check.Advisor, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -86,6 +89,10 @@ func (_m *mockChecksService) GetChecks() (map[string]check.Check, error) { ret := _m.Called() var r0 map[string]check.Check + var r1 error + if rf, ok := ret.Get(0).(func() (map[string]check.Check, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() map[string]check.Check); ok { r0 = rf() } else { @@ -94,7 +101,6 @@ func (_m *mockChecksService) GetChecks() (map[string]check.Check, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -109,6 +115,10 @@ func (_m *mockChecksService) GetChecksResults(ctx context.Context, serviceID str ret := _m.Called(ctx, serviceID) var r0 []services.CheckResult + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) ([]services.CheckResult, error)); ok { + return rf(ctx, serviceID) + } if rf, ok := ret.Get(0).(func(context.Context, string) []services.CheckResult); ok { r0 = rf(ctx, serviceID) } else { @@ -117,7 +127,6 @@ func (_m *mockChecksService) GetChecksResults(ctx context.Context, serviceID str } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, serviceID) } else { @@ -132,6 +141,10 @@ func (_m *mockChecksService) GetDisabledChecks() ([]string, error) { ret := _m.Called() var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func() ([]string, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []string); ok { r0 = rf() } else { @@ -140,7 +153,6 @@ func (_m *mockChecksService) GetDisabledChecks() ([]string, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -155,6 +167,10 @@ func (_m *mockChecksService) GetSecurityCheckResults() ([]services.CheckResult, ret := _m.Called() var r0 []services.CheckResult + var r1 error + if rf, ok := ret.Get(0).(func() ([]services.CheckResult, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() []services.CheckResult); ok { r0 = rf() } else { @@ -163,7 +179,6 @@ func (_m *mockChecksService) GetSecurityCheckResults() ([]services.CheckResult, } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -200,3 +215,18 @@ func (_m *mockChecksService) ToggleCheckAlert(ctx context.Context, alertID strin return r0 } + +// newMockChecksService creates a new instance of mockChecksService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockChecksService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockChecksService { + mock := &mockChecksService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/mock_connection_checker_test.go b/managed/services/management/mock_connection_checker_test.go index 560c8beafa..fba5fbe20e 100644 --- a/managed/services/management/mock_connection_checker_test.go +++ b/managed/services/management/mock_connection_checker_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package management @@ -29,3 +29,18 @@ func (_m *mockConnectionChecker) CheckConnectionToService(ctx context.Context, q return r0 } + +// newMockConnectionChecker creates a new instance of mockConnectionChecker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockConnectionChecker(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockConnectionChecker { + mock := &mockConnectionChecker{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/mock_grafana_client_test.go b/managed/services/management/mock_grafana_client_test.go index af714e11b5..47f47484f8 100644 --- a/managed/services/management/mock_grafana_client_test.go +++ b/managed/services/management/mock_grafana_client_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package management @@ -19,13 +19,16 @@ func (_m *mockGrafanaClient) CreateAnnotation(_a0 context.Context, _a1 []string, ret := _m.Called(_a0, _a1, _a2, _a3, _a4) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, []string, time.Time, string, string) (string, error)); ok { + return rf(_a0, _a1, _a2, _a3, _a4) + } if rf, ok := ret.Get(0).(func(context.Context, []string, time.Time, string, string) string); ok { r0 = rf(_a0, _a1, _a2, _a3, _a4) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, []string, time.Time, string, string) error); ok { r1 = rf(_a0, _a1, _a2, _a3, _a4) } else { @@ -34,3 +37,18 @@ func (_m *mockGrafanaClient) CreateAnnotation(_a0 context.Context, _a1 []string, return r0, r1 } + +// newMockGrafanaClient creates a new instance of mockGrafanaClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockGrafanaClient(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockGrafanaClient { + mock := &mockGrafanaClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/mock_jobs_service_test.go b/managed/services/management/mock_jobs_service_test.go index 3937a6a6c1..22e2e7baf3 100644 --- a/managed/services/management/mock_jobs_service_test.go +++ b/managed/services/management/mock_jobs_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package management @@ -22,3 +22,18 @@ func (_m *mockJobsService) StopJob(jobID string) error { return r0 } + +// newMockJobsService creates a new instance of mockJobsService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockJobsService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockJobsService { + mock := &mockJobsService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/mock_prometheus_service_test.go b/managed/services/management/mock_prometheus_service_test.go index 6decf5f1b0..2c7ae426f1 100644 --- a/managed/services/management/mock_prometheus_service_test.go +++ b/managed/services/management/mock_prometheus_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package management @@ -13,3 +13,18 @@ type mockPrometheusService struct { func (_m *mockPrometheusService) RequestConfigurationUpdate() { _m.Called() } + +// newMockPrometheusService creates a new instance of mockPrometheusService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockPrometheusService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockPrometheusService { + mock := &mockPrometheusService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/mock_version_cache_test.go b/managed/services/management/mock_version_cache_test.go index 063a059b57..55b49d89ed 100644 --- a/managed/services/management/mock_version_cache_test.go +++ b/managed/services/management/mock_version_cache_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package management @@ -13,3 +13,18 @@ type mockVersionCache struct { func (_m *mockVersionCache) RequestSoftwareVersionsUpdate() { _m.Called() } + +// newMockVersionCache creates a new instance of mockVersionCache. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockVersionCache(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockVersionCache { + mock := &mockVersionCache{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/mock_victoria_metrics_client_test.go b/managed/services/management/mock_victoria_metrics_client_test.go index a7e769730e..3a9733f06b 100644 --- a/managed/services/management/mock_victoria_metrics_client_test.go +++ b/managed/services/management/mock_victoria_metrics_client_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package management @@ -28,6 +28,11 @@ func (_m *mockVictoriaMetricsClient) Query(ctx context.Context, query string, ts ret := _m.Called(_ca...) var r0 model.Value + var r1 v1.Warnings + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, string, time.Time, ...v1.Option) (model.Value, v1.Warnings, error)); ok { + return rf(ctx, query, ts, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, string, time.Time, ...v1.Option) model.Value); ok { r0 = rf(ctx, query, ts, opts...) } else { @@ -36,7 +41,6 @@ func (_m *mockVictoriaMetricsClient) Query(ctx context.Context, query string, ts } } - var r1 v1.Warnings if rf, ok := ret.Get(1).(func(context.Context, string, time.Time, ...v1.Option) v1.Warnings); ok { r1 = rf(ctx, query, ts, opts...) } else { @@ -45,7 +49,6 @@ func (_m *mockVictoriaMetricsClient) Query(ctx context.Context, query string, ts } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, string, time.Time, ...v1.Option) error); ok { r2 = rf(ctx, query, ts, opts...) } else { @@ -54,3 +57,18 @@ func (_m *mockVictoriaMetricsClient) Query(ctx context.Context, query string, ts return r0, r1, r2 } + +// newMockVictoriaMetricsClient creates a new instance of mockVictoriaMetricsClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockVictoriaMetricsClient(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockVictoriaMetricsClient { + mock := &mockVictoriaMetricsClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/management/node.go b/managed/services/management/node.go index edf56ce48e..0c17d5e3ea 100644 --- a/managed/services/management/node.go +++ b/managed/services/management/node.go @@ -31,7 +31,7 @@ import ( "github.com/percona/pmm/managed/services" ) -//go:generate ../../../bin/mockery -name=apiKeyProvider -case=snake -inpkg -testonly +//go:generate ../../../bin/mockery --name=apiKeyProvider --case=snake --inpackage --testonly type apiKeyProvider interface { CreateAdminAPIKey(ctx context.Context, name string) (int64, string, error) diff --git a/managed/services/qan/deps.go b/managed/services/qan/deps.go index 10392dde07..f745e18e53 100644 --- a/managed/services/qan/deps.go +++ b/managed/services/qan/deps.go @@ -23,7 +23,7 @@ import ( qanpb "github.com/percona/pmm/api/qanpb" ) -//go:generate ../../../bin/mockery -name=qanCollectorClient -case=snake -inpkg -testonly +//go:generate ../../../bin/mockery --name=qanCollectorClient --case=snake --inpackage --testonly // qanClient is a subset of methods of qanpb.CollectorClient used by this package. // We use it instead of real type for testing. diff --git a/managed/services/qan/mock_qan_collector_client_test.go b/managed/services/qan/mock_qan_collector_client_test.go index 9919d1bab0..d865ccac66 100644 --- a/managed/services/qan/mock_qan_collector_client_test.go +++ b/managed/services/qan/mock_qan_collector_client_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package qan @@ -28,6 +28,10 @@ func (_m *mockQanCollectorClient) Collect(ctx context.Context, in *qanv1beta1.Co ret := _m.Called(_ca...) var r0 *qanv1beta1.CollectResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *qanv1beta1.CollectRequest, ...grpc.CallOption) (*qanv1beta1.CollectResponse, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *qanv1beta1.CollectRequest, ...grpc.CallOption) *qanv1beta1.CollectResponse); ok { r0 = rf(ctx, in, opts...) } else { @@ -36,7 +40,6 @@ func (_m *mockQanCollectorClient) Collect(ctx context.Context, in *qanv1beta1.Co } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *qanv1beta1.CollectRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -45,3 +48,18 @@ func (_m *mockQanCollectorClient) Collect(ctx context.Context, in *qanv1beta1.Co return r0, r1 } + +// newMockQanCollectorClient creates a new instance of mockQanCollectorClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockQanCollectorClient(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockQanCollectorClient { + mock := &mockQanCollectorClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/scheduler/deps.go b/managed/services/scheduler/deps.go index 1c2666303d..0820f524b5 100644 --- a/managed/services/scheduler/deps.go +++ b/managed/services/scheduler/deps.go @@ -21,7 +21,7 @@ import ( "github.com/percona/pmm/managed/services/backup" ) -//go:generate ../../../bin/mockery -name=backupService -case=snake -inpkg -testonly +//go:generate ../../../bin/mockery --name=backupService --case=snake --inpackage --testonly type backupService interface { PerformBackup(ctx context.Context, params backup.PerformBackupParams) (string, error) diff --git a/managed/services/scheduler/mock_backup_service_test.go b/managed/services/scheduler/mock_backup_service_test.go index 07c4a5a4fe..ca8449ad96 100644 --- a/managed/services/scheduler/mock_backup_service_test.go +++ b/managed/services/scheduler/mock_backup_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package scheduler @@ -20,13 +20,16 @@ func (_m *mockBackupService) PerformBackup(ctx context.Context, params backup.Pe ret := _m.Called(ctx, params) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, backup.PerformBackupParams) (string, error)); ok { + return rf(ctx, params) + } if rf, ok := ret.Get(0).(func(context.Context, backup.PerformBackupParams) string); ok { r0 = rf(ctx, params) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, backup.PerformBackupParams) error); ok { r1 = rf(ctx, params) } else { @@ -35,3 +38,18 @@ func (_m *mockBackupService) PerformBackup(ctx context.Context, params backup.Pe return r0, r1 } + +// newMockBackupService creates a new instance of mockBackupService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockBackupService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockBackupService { + mock := &mockBackupService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/server/deps.go b/managed/services/server/deps.go index 9563fa27a2..3eef78b54a 100644 --- a/managed/services/server/deps.go +++ b/managed/services/server/deps.go @@ -24,17 +24,17 @@ import ( "github.com/percona/pmm/version" ) -//go:generate ../../../bin/mockery -name=grafanaClient -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=prometheusService -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=alertmanagerService -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=checksService -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=vmAlertExternalRules -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=supervisordService -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=telemetryService -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=agentsStateUpdater -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=rulesService -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=emailer -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=templatesService -case=snake -inpkg -testonly +//go:generate ../../../bin/mockery --name=grafanaClient --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=prometheusService --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=alertmanagerService --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=checksService --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=vmAlertExternalRules --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=supervisordService --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=telemetryService --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=agentsStateUpdater --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=rulesService --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=emailer --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=templatesService --case=snake --inpackage --testonly // healthChecker interface wraps all services that implements the IsReady method to report the // service health for the Readiness check. diff --git a/managed/services/server/mock_agents_state_updater_test.go b/managed/services/server/mock_agents_state_updater_test.go index 73b82fe412..f898983cf7 100644 --- a/managed/services/server/mock_agents_state_updater_test.go +++ b/managed/services/server/mock_agents_state_updater_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package server @@ -26,3 +26,18 @@ func (_m *mockAgentsStateUpdater) UpdateAgentsState(ctx context.Context) error { return r0 } + +// newMockAgentsStateUpdater creates a new instance of mockAgentsStateUpdater. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockAgentsStateUpdater(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockAgentsStateUpdater { + mock := &mockAgentsStateUpdater{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/server/mock_alertmanager_service_test.go b/managed/services/server/mock_alertmanager_service_test.go index a8a63ba398..dccb8a57ac 100644 --- a/managed/services/server/mock_alertmanager_service_test.go +++ b/managed/services/server/mock_alertmanager_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package server @@ -31,3 +31,18 @@ func (_m *mockAlertmanagerService) IsReady(ctx context.Context) error { func (_m *mockAlertmanagerService) RequestConfigurationUpdate() { _m.Called() } + +// newMockAlertmanagerService creates a new instance of mockAlertmanagerService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockAlertmanagerService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockAlertmanagerService { + mock := &mockAlertmanagerService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/server/mock_checks_service_test.go b/managed/services/server/mock_checks_service_test.go index 8a564c7937..495e30987d 100644 --- a/managed/services/server/mock_checks_service_test.go +++ b/managed/services/server/mock_checks_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package server @@ -42,3 +42,18 @@ func (_m *mockChecksService) StartChecks(checkNames []string) error { func (_m *mockChecksService) UpdateIntervals(rare time.Duration, standard time.Duration, frequent time.Duration) { _m.Called(rare, standard, frequent) } + +// newMockChecksService creates a new instance of mockChecksService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockChecksService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockChecksService { + mock := &mockChecksService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/server/mock_emailer_test.go b/managed/services/server/mock_emailer_test.go index bf1475efd3..fd81326cba 100644 --- a/managed/services/server/mock_emailer_test.go +++ b/managed/services/server/mock_emailer_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package server @@ -28,3 +28,18 @@ func (_m *mockEmailer) Send(ctx context.Context, settings *models.EmailAlertingS return r0 } + +// newMockEmailer creates a new instance of mockEmailer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockEmailer(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockEmailer { + mock := &mockEmailer{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/server/mock_grafana_client_test.go b/managed/services/server/mock_grafana_client_test.go index 726d0ecf79..2c817be76d 100644 --- a/managed/services/server/mock_grafana_client_test.go +++ b/managed/services/server/mock_grafana_client_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package server @@ -26,3 +26,18 @@ func (_m *mockGrafanaClient) IsReady(ctx context.Context) error { return r0 } + +// newMockGrafanaClient creates a new instance of mockGrafanaClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockGrafanaClient(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockGrafanaClient { + mock := &mockGrafanaClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/server/mock_prometheus_service_test.go b/managed/services/server/mock_prometheus_service_test.go index 99e42ce4c6..e4282703be 100644 --- a/managed/services/server/mock_prometheus_service_test.go +++ b/managed/services/server/mock_prometheus_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package server @@ -31,3 +31,18 @@ func (_m *mockPrometheusService) IsReady(ctx context.Context) error { func (_m *mockPrometheusService) RequestConfigurationUpdate() { _m.Called() } + +// newMockPrometheusService creates a new instance of mockPrometheusService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockPrometheusService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockPrometheusService { + mock := &mockPrometheusService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/server/mock_rules_service_test.go b/managed/services/server/mock_rules_service_test.go index 81c9348dd8..f7774e2a64 100644 --- a/managed/services/server/mock_rules_service_test.go +++ b/managed/services/server/mock_rules_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package server @@ -27,3 +27,18 @@ func (_m *mockRulesService) RemoveVMAlertRulesFiles() error { func (_m *mockRulesService) WriteVMAlertRulesFiles() { _m.Called() } + +// newMockRulesService creates a new instance of mockRulesService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockRulesService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockRulesService { + mock := &mockRulesService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/server/mock_supervisord_service_test.go b/managed/services/server/mock_supervisord_service_test.go index a8a4e25d98..8263ddf2a6 100644 --- a/managed/services/server/mock_supervisord_service_test.go +++ b/managed/services/server/mock_supervisord_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package server @@ -52,6 +52,10 @@ func (_m *mockSupervisordService) LastCheckUpdatesResult(ctx context.Context) (* ret := _m.Called(ctx) var r0 *version.UpdateCheckResult + var r1 time.Time + if rf, ok := ret.Get(0).(func(context.Context) (*version.UpdateCheckResult, time.Time)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) *version.UpdateCheckResult); ok { r0 = rf(ctx) } else { @@ -60,7 +64,6 @@ func (_m *mockSupervisordService) LastCheckUpdatesResult(ctx context.Context) (* } } - var r1 time.Time if rf, ok := ret.Get(1).(func(context.Context) time.Time); ok { r1 = rf(ctx) } else { @@ -75,13 +78,16 @@ func (_m *mockSupervisordService) StartUpdate() (uint32, error) { ret := _m.Called() var r0 uint32 + var r1 error + if rf, ok := ret.Get(0).(func() (uint32, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() uint32); ok { r0 = rf() } else { r0 = ret.Get(0).(uint32) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -110,6 +116,11 @@ func (_m *mockSupervisordService) UpdateLog(offset uint32) ([]string, uint32, er ret := _m.Called(offset) var r0 []string + var r1 uint32 + var r2 error + if rf, ok := ret.Get(0).(func(uint32) ([]string, uint32, error)); ok { + return rf(offset) + } if rf, ok := ret.Get(0).(func(uint32) []string); ok { r0 = rf(offset) } else { @@ -118,14 +129,12 @@ func (_m *mockSupervisordService) UpdateLog(offset uint32) ([]string, uint32, er } } - var r1 uint32 if rf, ok := ret.Get(1).(func(uint32) uint32); ok { r1 = rf(offset) } else { r1 = ret.Get(1).(uint32) } - var r2 error if rf, ok := ret.Get(2).(func(uint32) error); ok { r2 = rf(offset) } else { @@ -148,3 +157,18 @@ func (_m *mockSupervisordService) UpdateRunning() bool { return r0 } + +// newMockSupervisordService creates a new instance of mockSupervisordService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockSupervisordService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockSupervisordService { + mock := &mockSupervisordService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/server/mock_telemetry_service_test.go b/managed/services/server/mock_telemetry_service_test.go index f1f2ea6095..d68973dd3f 100644 --- a/managed/services/server/mock_telemetry_service_test.go +++ b/managed/services/server/mock_telemetry_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package server @@ -42,3 +42,18 @@ func (_m *mockTelemetryService) GetSummaries() []string { return r0 } + +// newMockTelemetryService creates a new instance of mockTelemetryService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockTelemetryService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockTelemetryService { + mock := &mockTelemetryService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/server/mock_templates_service_test.go b/managed/services/server/mock_templates_service_test.go index 88a69361d2..ae6465fa8a 100644 --- a/managed/services/server/mock_templates_service_test.go +++ b/managed/services/server/mock_templates_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package server @@ -17,3 +17,18 @@ type mockTemplatesService struct { func (_m *mockTemplatesService) CollectTemplates(ctx context.Context) { _m.Called(ctx) } + +// newMockTemplatesService creates a new instance of mockTemplatesService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockTemplatesService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockTemplatesService { + mock := &mockTemplatesService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/server/mock_vm_alert_external_rules_test.go b/managed/services/server/mock_vm_alert_external_rules_test.go index 0d9bd80ed8..3c08560357 100644 --- a/managed/services/server/mock_vm_alert_external_rules_test.go +++ b/managed/services/server/mock_vm_alert_external_rules_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package server @@ -18,13 +18,16 @@ func (_m *mockVmAlertExternalRules) ReadRules() (string, error) { ret := _m.Called() var r0 string + var r1 error + if rf, ok := ret.Get(0).(func() (string, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -75,3 +78,18 @@ func (_m *mockVmAlertExternalRules) WriteRules(rules string) error { return r0 } + +// newMockVmAlertExternalRules creates a new instance of mockVmAlertExternalRules. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockVmAlertExternalRules(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockVmAlertExternalRules { + mock := &mockVmAlertExternalRules{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/telemetry/deps.go b/managed/services/telemetry/deps.go index 057a507200..148bd529a7 100644 --- a/managed/services/telemetry/deps.go +++ b/managed/services/telemetry/deps.go @@ -24,10 +24,10 @@ import ( "github.com/percona/pmm/api/serverpb" ) -//go:generate ../../../bin/mockery -name=distributionUtilService -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=sender -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=DataSourceLocator -case=snake -inpkg -testonly -//go:generate ../../../bin/mockery -name=DataSource -case=snake -inpkg -testonly +//go:generate ../../../bin/mockery --name=distributionUtilService --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=sender --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=DataSourceLocator --case=snake --inpackage --testonly +//go:generate ../../../bin/mockery --name=DataSource --case=snake --inpackage --testonly // distributionUtilService service to get info about OS on which pmm server is running type distributionUtilService interface { diff --git a/managed/services/telemetry/mock_data_source_locator_test.go b/managed/services/telemetry/mock_data_source_locator_test.go index a81dd2bd32..93ec35e84b 100644 --- a/managed/services/telemetry/mock_data_source_locator_test.go +++ b/managed/services/telemetry/mock_data_source_locator_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package telemetry @@ -14,6 +14,10 @@ func (_m *MockDataSourceLocator) LocateTelemetryDataSource(name string) (DataSou ret := _m.Called(name) var r0 DataSource + var r1 error + if rf, ok := ret.Get(0).(func(string) (DataSource, error)); ok { + return rf(name) + } if rf, ok := ret.Get(0).(func(string) DataSource); ok { r0 = rf(name) } else { @@ -22,7 +26,6 @@ func (_m *MockDataSourceLocator) LocateTelemetryDataSource(name string) (DataSou } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(name) } else { @@ -31,3 +34,18 @@ func (_m *MockDataSourceLocator) LocateTelemetryDataSource(name string) (DataSou return r0, r1 } + +// NewMockDataSourceLocator creates a new instance of MockDataSourceLocator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockDataSourceLocator(t interface { + mock.TestingT + Cleanup(func()) +}, +) *MockDataSourceLocator { + mock := &MockDataSourceLocator{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/telemetry/mock_data_source_test.go b/managed/services/telemetry/mock_data_source_test.go index b3ca7ee94f..e31e6a6cd2 100644 --- a/managed/services/telemetry/mock_data_source_test.go +++ b/managed/services/telemetry/mock_data_source_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package telemetry @@ -47,6 +47,10 @@ func (_m *MockDataSource) FetchMetrics(ctx context.Context, config Config) ([]*p ret := _m.Called(ctx, config) var r0 []*pmmv1.ServerMetric_Metric + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, Config) ([]*pmmv1.ServerMetric_Metric, error)); ok { + return rf(ctx, config) + } if rf, ok := ret.Get(0).(func(context.Context, Config) []*pmmv1.ServerMetric_Metric); ok { r0 = rf(ctx, config) } else { @@ -55,7 +59,6 @@ func (_m *MockDataSource) FetchMetrics(ctx context.Context, config Config) ([]*p } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, Config) error); ok { r1 = rf(ctx, config) } else { @@ -78,3 +81,18 @@ func (_m *MockDataSource) Init(ctx context.Context) error { return r0 } + +// NewMockDataSource creates a new instance of MockDataSource. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockDataSource(t interface { + mock.TestingT + Cleanup(func()) +}, +) *MockDataSource { + mock := &MockDataSource{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/telemetry/mock_distribution_util_service_test.go b/managed/services/telemetry/mock_distribution_util_service_test.go index 8246512c39..6791db614d 100644 --- a/managed/services/telemetry/mock_distribution_util_service_test.go +++ b/managed/services/telemetry/mock_distribution_util_service_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package telemetry @@ -19,20 +19,23 @@ func (_m *mockDistributionUtilService) getDistributionMethodAndOS() (serverpb.Di ret := _m.Called() var r0 serverpb.DistributionMethod + var r1 pmmv1.DistributionMethod + var r2 string + if rf, ok := ret.Get(0).(func() (serverpb.DistributionMethod, pmmv1.DistributionMethod, string)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() serverpb.DistributionMethod); ok { r0 = rf() } else { r0 = ret.Get(0).(serverpb.DistributionMethod) } - var r1 pmmv1.DistributionMethod if rf, ok := ret.Get(1).(func() pmmv1.DistributionMethod); ok { r1 = rf() } else { r1 = ret.Get(1).(pmmv1.DistributionMethod) } - var r2 string if rf, ok := ret.Get(2).(func() string); ok { r2 = rf() } else { @@ -41,3 +44,18 @@ func (_m *mockDistributionUtilService) getDistributionMethodAndOS() (serverpb.Di return r0, r1, r2 } + +// newMockDistributionUtilService creates a new instance of mockDistributionUtilService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockDistributionUtilService(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockDistributionUtilService { + mock := &mockDistributionUtilService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/telemetry/mock_sender_test.go b/managed/services/telemetry/mock_sender_test.go index 7e32b58cee..fe335c60cf 100644 --- a/managed/services/telemetry/mock_sender_test.go +++ b/managed/services/telemetry/mock_sender_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package telemetry @@ -27,3 +27,18 @@ func (_m *mockSender) SendTelemetry(ctx context.Context, report *reporterv1.Repo return r0 } + +// newMockSender creates a new instance of mockSender. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func newMockSender(t interface { + mock.TestingT + Cleanup(func()) +}, +) *mockSender { + mock := &mockSender{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/versioncache/mock_versioner_test.go b/managed/services/versioncache/mock_versioner_test.go index 442c06f943..b580c766ed 100644 --- a/managed/services/versioncache/mock_versioner_test.go +++ b/managed/services/versioncache/mock_versioner_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.0.0. DO NOT EDIT. +// Code generated by mockery v2.30.16. DO NOT EDIT. package versioncache @@ -18,6 +18,10 @@ func (_m *MockVersioner) GetVersions(pmmAgentID string, softwares []agents.Softw ret := _m.Called(pmmAgentID, softwares) var r0 []agents.Version + var r1 error + if rf, ok := ret.Get(0).(func(string, []agents.Software) ([]agents.Version, error)); ok { + return rf(pmmAgentID, softwares) + } if rf, ok := ret.Get(0).(func(string, []agents.Software) []agents.Version); ok { r0 = rf(pmmAgentID, softwares) } else { @@ -26,7 +30,6 @@ func (_m *MockVersioner) GetVersions(pmmAgentID string, softwares []agents.Softw } } - var r1 error if rf, ok := ret.Get(1).(func(string, []agents.Software) error); ok { r1 = rf(pmmAgentID, softwares) } else { @@ -35,3 +38,18 @@ func (_m *MockVersioner) GetVersions(pmmAgentID string, softwares []agents.Softw return r0, r1 } + +// NewMockVersioner creates a new instance of MockVersioner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockVersioner(t interface { + mock.TestingT + Cleanup(func()) +}, +) *MockVersioner { + mock := &MockVersioner{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/managed/services/versioncache/versioncache.go b/managed/services/versioncache/versioncache.go index 79c19409e9..aaa4d006b6 100644 --- a/managed/services/versioncache/versioncache.go +++ b/managed/services/versioncache/versioncache.go @@ -36,7 +36,7 @@ var ( minCheckInterval = 5 * time.Second ) -//go:generate ../../../bin/mockery -name=Versioner -case=snake -inpkg -testonly +//go:generate ../../../bin/mockery --name=Versioner --case=snake --inpackage --testonly // Versioner contains method for retrieving versions of different software. type Versioner interface { diff --git a/tools/go.mod b/tools/go.mod index f12b907249..97e48a1fd8 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -20,7 +20,7 @@ require ( github.com/quasilyte/go-consistent v0.0.0-20200404105227-766526bf1e96 github.com/reviewdog/reviewdog v0.14.1 github.com/vburenin/ifacemaker v1.2.1 - github.com/vektra/mockery v1.1.2 + github.com/vektra/mockery/v2 v2.30.16 golang.org/x/perf v0.0.0-20211012211434-03971e389cd3 golang.org/x/tools v0.10.0 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 @@ -47,6 +47,7 @@ require ( github.com/bufbuild/connect-go v1.8.0 // indirect github.com/bufbuild/connect-opentelemetry-go v0.3.0 // indirect github.com/bufbuild/protocompile v0.5.1 // indirect + github.com/chigopher/pathlib v0.15.0 // indirect github.com/cilium/ebpf v0.7.0 // indirect github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect github.com/cosiner/argv v0.1.0 // indirect @@ -61,7 +62,7 @@ require ( github.com/docker/go-units v0.5.0 // indirect github.com/felixge/fgprof v0.9.3 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect - github.com/fsnotify/fsnotify v1.5.4 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-chi/chi/v5 v5.0.8 // indirect github.com/go-delve/liner v1.2.3-0.20220127212407-d32d89dd2a5d // indirect github.com/go-logr/logr v1.2.4 // indirect @@ -117,6 +118,7 @@ require ( github.com/jackc/pgx v3.6.2+incompatible // indirect github.com/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84 // indirect github.com/jessevdk/go-flags v1.5.0 // indirect + github.com/jinzhu/copier v0.3.5 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/kisielk/gotool v1.0.0 // indirect github.com/klauspost/compress v1.16.6 // indirect @@ -125,10 +127,10 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.6 // indirect github.com/lyft/protoc-gen-star/v2 v2.0.3 // indirect - github.com/magiconair/properties v1.8.6 // indirect + github.com/magiconair/properties v1.8.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect - github.com/mattn/go-colorable v0.1.12 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.17 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect github.com/mattn/go-shellwords v1.0.12 // indirect github.com/mattn/go-sqlite3 v1.14.5 // indirect @@ -142,8 +144,7 @@ require ( github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc3 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect - github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.0.2 // indirect + github.com/pelletier/go-toml/v2 v2.0.6 // indirect github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pkg/profile v1.7.0 // indirect @@ -153,16 +154,17 @@ require ( github.com/rivo/uniseg v0.2.0 // indirect github.com/rogpeppe/go-internal v1.10.0 // indirect github.com/rs/cors v1.9.0 // indirect + github.com/rs/zerolog v1.29.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shopspring/decimal v1.2.0 // indirect github.com/sirupsen/logrus v1.9.3 // indirect - github.com/spf13/afero v1.9.2 // indirect + github.com/spf13/afero v1.9.3 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/cobra v1.7.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.12.0 // indirect - github.com/subosito/gotenv v1.4.0 // indirect + github.com/spf13/viper v1.15.0 // indirect + github.com/subosito/gotenv v1.4.2 // indirect github.com/tetratelabs/wazero v1.2.1 // indirect github.com/toqueteos/webbrowser v1.2.0 // indirect github.com/vbatts/tar-split v0.11.3 // indirect @@ -189,7 +191,7 @@ require ( golang.org/x/sys v0.9.0 // indirect golang.org/x/term v0.9.0 // indirect golang.org/x/text v0.10.0 // indirect - golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect + golang.org/x/time v0.1.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.114.0 // indirect google.golang.org/appengine v1.6.7 // indirect @@ -198,7 +200,7 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect google.golang.org/grpc v1.55.0 // indirect gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect - gopkg.in/ini.v1 v1.66.6 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/tools/go.sum b/tools/go.sum index b85127f518..bc2de9e375 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -113,6 +113,8 @@ github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+ github.com/bufbuild/protocompile v0.5.1/go.mod h1:G5iLmavmF4NsYtpZFvE3B/zFch2GIY8+wjsYLR/lc40= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/chigopher/pathlib v0.15.0 h1:1pg96WL3iC1/YyWV4UJSl3E0GBf4B+h5amBtsbAAieY= +github.com/chigopher/pathlib v0.15.0/go.mod h1:3+YPPV21mU9vyw8Mjp+F33CyCfE6iOzinpiqBcccv7I= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -131,6 +133,7 @@ github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosiner/argv v0.1.0 h1:BVDiEL32lwHukgJKP87btEPenzrrHUjajs/8yzaqcXg= github.com/cosiner/argv v0.1.0/go.mod h1:EusR6TucWKX+zFgtdUsKT2Cvg45K5rtpCcWz4hK06d8= @@ -182,8 +185,8 @@ github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0= @@ -280,6 +283,7 @@ github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWe github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= @@ -467,6 +471,8 @@ github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0 github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg= +github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -511,8 +517,8 @@ github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lyft/protoc-gen-star/v2 v2.0.3 h1:/3+/2sWyXeMLzKd1bX+ixWKgEMsULrIivpDsuaF441o= github.com/lyft/protoc-gen-star/v2 v2.0.3/go.mod h1:amey7yeodaJhXSbf/TlLvWiqQfLOSpEk//mLlc+axEk= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= -github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= @@ -521,11 +527,14 @@ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= @@ -574,10 +583,8 @@ github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYr github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= -github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= -github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.2 h1:+jQXlF3scKIcSEKkdHzXhCTDLPFi5r1wnK6yPS+49Gw= -github.com/pelletier/go-toml/v2 v2.0.2/go.mod h1:MovirKjgVRESsAvNZlAjtFwV867yGuwRkXbG66OzopI= +github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= +github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -622,6 +629,9 @@ github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjR github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/rs/cors v1.9.0 h1:l9HGsTsHJcvW14Nk7J9KFz8bzeAWXn3CG6bgt7LsrAE= github.com/rs/cors v1.9.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.29.0 h1:Zes4hju04hjbvkVkOhdl2HpZa+0PmVwigmo8XoORE5w= +github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -644,8 +654,8 @@ github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9 github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= -github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk= +github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= @@ -662,8 +672,8 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= -github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= +github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= +github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -676,13 +686,12 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/subosito/gotenv v1.4.0 h1:yAzM1+SmVcz5R4tXGsNMu1jUl2aOJXoiWUCEwwnGrvs= -github.com/subosito/gotenv v1.4.0/go.mod h1:mZd6rFysKEcUhUHXJk0C/08wAgyDBFuwEYL7vWWGaGo= +github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= +github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/tetratelabs/wazero v1.2.1 h1:J4X2hrGzJvt+wqltuvcSjHQ7ujQxA9gb6PeMs4qlUWs= github.com/tetratelabs/wazero v1.2.1/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ= @@ -696,8 +705,8 @@ github.com/vbatts/tar-split v0.11.3 h1:hLFqsOLQ1SsppQNTMpkpPXClLDfC2A3Zgy9OUU+RV github.com/vbatts/tar-split v0.11.3/go.mod h1:9QlHN18E+fEH7RdG+QAJJcuya3rqT7eXSTY7wGrAokY= github.com/vburenin/ifacemaker v1.2.1 h1:3Vq8B/bfBgjWTkv+jDg4dVL1KHt3k1K4lO7XRxYA2sk= github.com/vburenin/ifacemaker v1.2.1/go.mod h1:5WqrzX2aD7/hi+okBjcaEQJMg4lDGrpuEX3B8L4Wgrs= -github.com/vektra/mockery v1.1.2 h1:uc0Yn67rJpjt8U/mAZimdCKn9AeA97BOkjpmtBSlfP4= -github.com/vektra/mockery v1.1.2/go.mod h1:VcfZjKaFOPO+MpN4ZvwPjs4c48lkq1o3Ym8yHZJu0jU= +github.com/vektra/mockery/v2 v2.30.16 h1:XbUaK84eY7Hl/y6JeT7hVaA59Jgo4owlNWWgfL/gCQU= +github.com/vektra/mockery/v2 v2.30.16/go.mod h1:9lREs4VEeQiUS3rizYQx1saxHu2JiIhThP0q9+fDegM= github.com/vvakame/sdlog v0.0.0-20200409072131-7c0d359efddc h1:El7LEavRpa49dYFE9ezO8aQxQn5E7u7eQkFsaXsoQAY= github.com/vvakame/sdlog v0.0.0-20200409072131-7c0d359efddc/go.mod h1:MmhrKtbECoUJTctfak+MnOFoJ9XQqYZ7chcwV9O7v3I= github.com/xanzy/go-gitlab v0.63.0 h1:a9fXpKWykUS6dowapFej/2Wjf4aOAEFC1q2ZIcz4IpI= @@ -940,7 +949,6 @@ golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211117180635-dee7805ff2e1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -969,8 +977,8 @@ golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA= +golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1012,7 +1020,6 @@ golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200323144430-8dcfad9e016e/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200329025819-fd4102a86c65/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200406213809-066fd1390ee0/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -1161,8 +1168,8 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.66.6 h1:LATuAqN/shcYAOkv3wl2L4rkaKqkcgTBQjOyYDvcPKI= -gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/reform.v1 v1.5.1 h1:7vhDFW1n1xAPC6oDSvIvVvpRkaRpXlxgJ4QB4s3aDdo= gopkg.in/reform.v1 v1.5.1/go.mod h1:AIv0CbDRJ0ljQwptGeaIXfpDRo02uJwTq92aMFELEeU= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= diff --git a/tools/tools.go b/tools/tools.go index 2253150a33..bbe45acd65 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -34,7 +34,7 @@ import ( _ "github.com/quasilyte/go-consistent" _ "github.com/reviewdog/reviewdog/cmd/reviewdog" _ "github.com/vburenin/ifacemaker" - _ "github.com/vektra/mockery/cmd/mockery" + _ "github.com/vektra/mockery/v2" _ "golang.org/x/perf/cmd/benchstat" _ "golang.org/x/tools/cmd/goimports" _ "google.golang.org/grpc/cmd/protoc-gen-go-grpc" @@ -53,7 +53,7 @@ import ( //go:generate go build -o ../bin/go-sumtype github.com/BurntSushi/go-sumtype //go:generate go build -o ../bin/gofumpt mvdan.cc/gofumpt //go:generate go build -o ../bin/goimports golang.org/x/tools/cmd/goimports -//go:generate go build -o ../bin/mockery github.com/vektra/mockery/cmd/mockery +//go:generate go build -o ../bin/mockery github.com/vektra/mockery/v2 //go:generate go build -o ../bin/protoc-gen-go google.golang.org/protobuf/cmd/protoc-gen-go //go:generate go build -o ../bin/protoc-gen-go-grpc google.golang.org/grpc/cmd/protoc-gen-go-grpc //go:generate go build -o ../bin/protoc-gen-grpc-gateway github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway