From b34d4dc0a0b7a7d7f48a962efe230564ba1cc316 Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Fri, 6 Oct 2023 10:36:37 +0200 Subject: [PATCH] clean up gitignore and commit missing mocks --- docs/.gitignore | 2 + docs/helpers/extended_vars.yaml | 82 --------------- .../clientlog/mocks/event_history_service.go | 99 +++++++++++++++++++ 3 files changed, 101 insertions(+), 82 deletions(-) delete mode 100644 docs/helpers/extended_vars.yaml create mode 100644 services/clientlog/mocks/event_history_service.go diff --git a/docs/.gitignore b/docs/.gitignore index b0079cf9d..73d0aef38 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -2,3 +2,5 @@ hugo/ grpc_apis/ mutagen.yml.lock helpers/output/* +helpers/extended_vars.yaml +services/**/_index.md diff --git a/docs/helpers/extended_vars.yaml b/docs/helpers/extended_vars.yaml deleted file mode 100644 index d30d070b6..000000000 --- a/docs/helpers/extended_vars.yaml +++ /dev/null @@ -1,82 +0,0 @@ -variables: -- rawname: CS3_GATEWAY - path: services/idp/pkg/backends/cs3/bootstrap/cs3.go:76 - foundincode: true - name: CS3_GATEWAY - type: "" - default_value: "" - description: "" - do_ignore: true -- rawname: CS3_MACHINE_AUTH_API_KEY - path: services/idp/pkg/backends/cs3/bootstrap/cs3.go:77 - foundincode: true - name: CS3_MACHINE_AUTH_API_KEY - type: "" - default_value: "" - description: "" - do_ignore: true -- rawname: MICRO_LOG_LEVEL - path: ocis-pkg/log/log.go:31 - foundincode: true - name: MICRO_LOG_LEVEL - type: string - default_value: Error - description: Set the log level for the internal go micro framework. Only change - on supervision of ownCloud Support. - do_ignore: false -- rawname: MICRO_LOG_LEVEL - path: ocis-pkg/log/log.go:35 - foundincode: true - name: MICRO_LOG_LEVEL - type: "" - default_value: "" - description: "" - do_ignore: true -- rawname: registryEnv - path: ocis-pkg/registry/registry.go:44 - foundincode: true - name: MICRO_REGISTRY - type: string - default_value: "" - description: 'Go micro registry type to use. Supported types are: ''nats'', ''kubernetes'', - ''etcd'', ''consul'', ''memory'' and ''mdns''. Will be selected automatically. Only change - on supervision of ownCloud Support.' - do_ignore: false -- rawname: registryAddressEnv - path: ocis-pkg/registry/registry.go:42 - foundincode: true - name: MICRO_REGISTRY_ADDRESS - type: string - default_value: "" - description: The bind address of the internal go micro framework. Only change on - supervision of ownCloud Support. - do_ignore: false -- rawname: OCIS_BASE_DATA_PATH - path: ocis-pkg/config/defaults/paths.go:23 - foundincode: true - name: OCIS_BASE_DATA_PATH - type: string - default_value: '''/var/lib/ocis'' or ''$HOME/.ocis/''' - description: The base directory location used by several services and for user data. - Predefined to '/var/lib/ocis' for container images (inside the container) or '$HOME/.ocis/' - for binary releases. Services can have, if available, an individual setting with - an own environment variable. - do_ignore: false -- rawname: OCIS_CONFIG_DIR - path: ocis-pkg/config/defaults/paths.go:56 - foundincode: true - name: OCIS_CONFIG_DIR - type: string - default_value: '''/etc/ocis'' or ''$HOME/.ocis/config''' - description: The default directory location for config files. Predefined to '/etc/ocis' - for container images (inside the container) or '$HOME/.ocis/config' for binary - releases. - do_ignore: false -- rawname: parts[0] - path: ocis-pkg/config/envdecode/envdecode.go:382 - foundincode: true - name: parts[0] - type: "" - default_value: "" - description: false positive - code that extract envvars for config structs - do_ignore: true diff --git a/services/clientlog/mocks/event_history_service.go b/services/clientlog/mocks/event_history_service.go new file mode 100644 index 000000000..42580a19a --- /dev/null +++ b/services/clientlog/mocks/event_history_service.go @@ -0,0 +1,99 @@ +// Code generated by mockery v2.22.1. DO NOT EDIT. + +package mocks + +import ( + context "context" + + client "go-micro.dev/v4/client" + + mock "github.com/stretchr/testify/mock" + + v0 "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/eventhistory/v0" +) + +// EventHistoryService is an autogenerated mock type for the EventHistoryService type +type EventHistoryService struct { + mock.Mock +} + +// GetEvents provides a mock function with given fields: ctx, in, opts +func (_m *EventHistoryService) GetEvents(ctx context.Context, in *v0.GetEventsRequest, opts ...client.CallOption) (*v0.GetEventsResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *v0.GetEventsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v0.GetEventsRequest, ...client.CallOption) (*v0.GetEventsResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *v0.GetEventsRequest, ...client.CallOption) *v0.GetEventsResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v0.GetEventsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v0.GetEventsRequest, ...client.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetEventsForUser provides a mock function with given fields: ctx, in, opts +func (_m *EventHistoryService) GetEventsForUser(ctx context.Context, in *v0.GetEventsForUserRequest, opts ...client.CallOption) (*v0.GetEventsResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + var r0 *v0.GetEventsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v0.GetEventsForUserRequest, ...client.CallOption) (*v0.GetEventsResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *v0.GetEventsForUserRequest, ...client.CallOption) *v0.GetEventsResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v0.GetEventsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v0.GetEventsForUserRequest, ...client.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +type mockConstructorTestingTNewEventHistoryService interface { + mock.TestingT + Cleanup(func()) +} + +// NewEventHistoryService creates a new instance of EventHistoryService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewEventHistoryService(t mockConstructorTestingTNewEventHistoryService) *EventHistoryService { + mock := &EventHistoryService{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +}