chore(Makefile): add go generate target (#6944)

This change adds a core_generate_all make target.
It installs the required tools and runs generate on the complete project.

`golang/mock` is no longer maintained and a fork is available
from the Uber folks. So the latter is used as tool.
All the mock files have been regenerated and are part of the PR.

The obsolete `tools` directory has been removed,
as all the tools are now part of specific make targets.

Co-authored-by: Silvan <silvan.reusser@gmail.com>
This commit is contained in:
Tim Möhlmann
2023-11-22 12:56:43 +02:00
committed by GitHub
parent 2de7ce99c5
commit 2f91679623
64 changed files with 368 additions and 1977 deletions

View File

@@ -1,6 +1,10 @@
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/zitadel/zitadel/internal/eventstore (interfaces: Querier,Pusher)
//
// Generated by this command:
//
// mockgen -package mock -destination ./repository.mock.go github.com/zitadel/zitadel/internal/eventstore Querier,Pusher
//
// Package mock is a generated GoMock package.
package mock
@@ -8,8 +12,8 @@ import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
eventstore "github.com/zitadel/zitadel/internal/eventstore"
gomock "go.uber.org/mock/gomock"
)
// MockQuerier is a mock of Querier interface.
@@ -44,7 +48,7 @@ func (m *MockQuerier) FilterToReducer(arg0 context.Context, arg1 *eventstore.Sea
}
// FilterToReducer indicates an expected call of FilterToReducer.
func (mr *MockQuerierMockRecorder) FilterToReducer(arg0, arg1, arg2 interface{}) *gomock.Call {
func (mr *MockQuerierMockRecorder) FilterToReducer(arg0, arg1, arg2 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FilterToReducer", reflect.TypeOf((*MockQuerier)(nil).FilterToReducer), arg0, arg1, arg2)
}
@@ -58,7 +62,7 @@ func (m *MockQuerier) Health(arg0 context.Context) error {
}
// Health indicates an expected call of Health.
func (mr *MockQuerierMockRecorder) Health(arg0 interface{}) *gomock.Call {
func (mr *MockQuerierMockRecorder) Health(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Health", reflect.TypeOf((*MockQuerier)(nil).Health), arg0)
}
@@ -73,7 +77,7 @@ func (m *MockQuerier) InstanceIDs(arg0 context.Context, arg1 *eventstore.SearchQ
}
// InstanceIDs indicates an expected call of InstanceIDs.
func (mr *MockQuerierMockRecorder) InstanceIDs(arg0, arg1 interface{}) *gomock.Call {
func (mr *MockQuerierMockRecorder) InstanceIDs(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InstanceIDs", reflect.TypeOf((*MockQuerier)(nil).InstanceIDs), arg0, arg1)
}
@@ -88,7 +92,7 @@ func (m *MockQuerier) LatestSequence(arg0 context.Context, arg1 *eventstore.Sear
}
// LatestSequence indicates an expected call of LatestSequence.
func (mr *MockQuerierMockRecorder) LatestSequence(arg0, arg1 interface{}) *gomock.Call {
func (mr *MockQuerierMockRecorder) LatestSequence(arg0, arg1 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LatestSequence", reflect.TypeOf((*MockQuerier)(nil).LatestSequence), arg0, arg1)
}
@@ -125,7 +129,7 @@ func (m *MockPusher) Health(arg0 context.Context) error {
}
// Health indicates an expected call of Health.
func (mr *MockPusherMockRecorder) Health(arg0 interface{}) *gomock.Call {
func (mr *MockPusherMockRecorder) Health(arg0 any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Health", reflect.TypeOf((*MockPusher)(nil).Health), arg0)
}
@@ -133,7 +137,7 @@ func (mr *MockPusherMockRecorder) Health(arg0 interface{}) *gomock.Call {
// Push mocks base method.
func (m *MockPusher) Push(arg0 context.Context, arg1 ...eventstore.Command) ([]eventstore.Event, error) {
m.ctrl.T.Helper()
varargs := []interface{}{arg0}
varargs := []any{arg0}
for _, a := range arg1 {
varargs = append(varargs, a)
}
@@ -144,8 +148,8 @@ func (m *MockPusher) Push(arg0 context.Context, arg1 ...eventstore.Command) ([]e
}
// Push indicates an expected call of Push.
func (mr *MockPusherMockRecorder) Push(arg0 interface{}, arg1 ...interface{}) *gomock.Call {
func (mr *MockPusherMockRecorder) Push(arg0 any, arg1 ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{arg0}, arg1...)
varargs := append([]any{arg0}, arg1...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Push", reflect.TypeOf((*MockPusher)(nil).Push), varargs...)
}

View File

@@ -7,8 +7,8 @@ import (
"testing"
"time"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"
"github.com/zitadel/zitadel/internal/eventstore"
"github.com/zitadel/zitadel/internal/eventstore/repository"

View File

@@ -5,7 +5,7 @@ import (
"fmt"
"reflect"
"github.com/golang/mock/gomock"
"go.uber.org/mock/gomock"
"github.com/zitadel/zitadel/internal/eventstore/repository"
)