Skip to content

Commit

Permalink
Fix mocks (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 authored Feb 23, 2024
1 parent 37950af commit ee25d59
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ mocks:
--user $$(id -u):$$(id -g) \
-w /work \
-v ${PWD}:/work \
vektra/mockery:v2.38.0 -r --keeptree --dir api/v1 --output api/v1/mocks --all
vektra/mockery:v2.42.0 -r --keeptree --dir api/v1 --output api/v1/mocks --all

docker run --rm \
--user $$(id -u):$$(id -g) \
-w /work \
-v ${PWD}:/work \
vektra/mockery:v2.38.0 -r --keeptree --dir pkg/datastore --output pkg/datastore/mocks --all
vektra/mockery:v2.42.0 -r --keeptree --dir pkg/datastore --output pkg/datastore/mocks --all

.PHONY: postgres-up
postgres-up: postgres-rm
Expand Down
2 changes: 1 addition & 1 deletion api/v1/mocks/ProjectMemberServiceClient.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/v1/mocks/ProjectMemberServiceServer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/v1/mocks/ProjectServiceClient.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/v1/mocks/ProjectServiceServer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/v1/mocks/TenantServiceClient.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/v1/mocks/TenantServiceServer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/v1/mocks/UnsafeProjectMemberServiceServer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/v1/mocks/UnsafeProjectServiceServer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/v1/mocks/UnsafeTenantServiceServer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions pkg/client/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ import (
)

type MockClient struct {
psc v1.ProjectServiceClient
tsc v1.TenantServiceClient
psc v1.ProjectServiceClient
tsc v1.TenantServiceClient
pmsc v1.ProjectMemberServiceClient
}

func NewMock(psc v1.ProjectServiceClient, tsc v1.TenantServiceClient) *MockClient {
func NewMock(psc v1.ProjectServiceClient, tsc v1.TenantServiceClient, pmsc v1.ProjectMemberServiceClient) *MockClient {
return &MockClient{
psc: psc,
tsc: tsc,
psc: psc,
tsc: tsc,
pmsc: pmsc,
}
}

Expand All @@ -22,6 +24,9 @@ func (c *MockClient) Close() error {
func (c *MockClient) Project() v1.ProjectServiceClient {
return c.psc
}
func (c *MockClient) ProjectMember() v1.ProjectMemberServiceClient {
return c.pmsc
}

func (c *MockClient) Tenant() v1.TenantServiceClient {
return c.tsc
Expand Down
2 changes: 1 addition & 1 deletion pkg/datastore/mocks/Entity.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/datastore/mocks/Storage.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ee25d59

Please sign in to comment.