From 58fea61cc43bbc8b796fb0780d317a3f7b117df3 Mon Sep 17 00:00:00 2001 From: Tim Scheuermann Date: Tue, 5 Jul 2022 18:39:31 +0300 Subject: [PATCH] Add mocks, layers and generated as rules to the make file (#20585) --- .circleci/config.yml | 4 ++-- Makefile | 6 ++++++ services/sharedchannel/mock_AppIface_test.go | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e6554557e5..903d44dfc3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -170,8 +170,8 @@ jobs: - run: command: | cd mattermost-server - make einterfaces-mocks store-mocks - if [[ -n $(git status --porcelain) ]]; then echo "Please update the mocks using `make einterfaces-mocks store-mocks`"; exit 1; fi + make mocks + if [[ -n $(git status --porcelain) ]]; then echo "Please update the mocks using `make mocks`"; exit 1; fi check-email-templates: docker: diff --git a/Makefile b/Makefile index 04736c8df6..240644a69d 100644 --- a/Makefile +++ b/Makefile @@ -390,6 +390,12 @@ email-mocks: ## Creates mocks for misc interfaces. pluginapi: ## Generates api and hooks glue code for plugins $(GO) generate $(GOFLAGS) ./plugin +mocks: store-mocks telemetry-mocks filestore-mocks ldap-mocks plugin-mocks einterfaces-mocks searchengine-mocks sharedchannel-mocks misc-mocks email-mocks + +layers: app-layers store-layers pluginapi + +generated: mocks layers + check-prereqs: ## Checks prerequisite software status. ./scripts/prereq-check.sh diff --git a/services/sharedchannel/mock_AppIface_test.go b/services/sharedchannel/mock_AppIface_test.go index 2e996458dc..75b3f810b4 100644 --- a/services/sharedchannel/mock_AppIface_test.go +++ b/services/sharedchannel/mock_AppIface_test.go @@ -202,11 +202,11 @@ func (_m *MockAppIface) FileReader(path string) (filestore.ReadCloseSeeker, *mod // GetOrCreateDirectChannel provides a mock function with given fields: c, userId, otherUserId, channelOptions func (_m *MockAppIface) GetOrCreateDirectChannel(c *request.Context, userId string, otherUserId string, channelOptions ...model.ChannelOption) (*model.Channel, *model.AppError) { - _va := make([]any, len(channelOptions)) + _va := make([]interface{}, len(channelOptions)) for _i := range channelOptions { _va[_i] = channelOptions[_i] } - var _ca []any + var _ca []interface{} _ca = append(_ca, c, userId, otherUserId) _ca = append(_ca, _va...) ret := _m.Called(_ca...)