Skip to content

Commit

Permalink
chore: switch to mockery config file (#9473)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShreyaLnuHpe authored Jun 5, 2024
1 parent 9160ae9 commit ca03da1
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 19 deletions.
106 changes: 106 additions & 0 deletions master/.mockery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# .mockery.yaml
with-expecter: True
dir: internal/mocks
outpkg: mocks
quiet: True
packages:
github.com/determined-ai/determined/master/internal/db:
interfaces:
DB:
config:
filename: db.go
mockname: DB
github.com/determined-ai/determined/master/internal/sproto:
interfaces:
Resources:
config:
filename: resources.go
mockname: Resources
github.com/determined-ai/determined/master/internal/user:
interfaces:
UserAuthZ:
config:
filename: user_authz_iface.go
mockname: UserAuthZ
github.com/determined-ai/determined/master/internal/workspace:
interfaces:
WorkspaceAuthZ:
config:
filename: workspace_authz_iface.go
mockname: WorkspaceAuthZ
github.com/determined-ai/determined/master/internal/project:
interfaces:
ProjectAuthZ:
config:
filename: project_authz_iface.go
mockname: ProjectAuthZ
github.com/determined-ai/determined/master/internal/experiment:
interfaces:
ExperimentAuthZ:
config:
filename: authz_experiment_iface.go
mockname: ExperimentAuthZ
github.com/determined-ai/determined/master/internal/command:
interfaces:
NSCAuthZ:
config:
filename: nsc_authz_iface.go
mockname: NSCAuthZ
github.com/determined-ai/determined/master/internal/model:
interfaces:
ModelAuthZ:
config:
filename: authz_model_iface.go
mockname: ModelAuthZ
github.com/determined-ai/determined/master/internal/rm:
interfaces:
ResourceManager:
config:
filename: rm.go
mockname: ResourceManager
ResourceManagerAuthZ:
config:
filename: rm_authz_iface.go
mockname: ResourceManagerAuthZ
github.com/determined-ai/determined/master/internal/task:
interfaces:
AllocationService:
config:
filename: allocation_service.go
mockname: AllocationService
dir: internal/mocks/allocationmocks
outpkg: allocationmocks
k8s.io/client-go/kubernetes/typed/core/v1:
interfaces:
PodInterface:
config:
filename: pod_iface.go
mockname: PodInterface
EventInterface:
config:
filename: event_iface.go
mockname: EventInterface
NodeInterface:
config:
filename: node_iface.go
mockname: NodeInterface
CoreV1Interface:
config:
filename: k8s_corev1_iface.go
mockname: K8sCoreV1Interface
k8s.io/client-go/kubernetes/typed/batch/v1:
interfaces:
JobInterface:
config:
filename: job_iface.go
mockname: JobInterface
BatchV1Interface:
config:
filename: k8s_batchv1_iface.go
mockname: K8sBatchV1Interface
k8s.io/client-go/kubernetes:
interfaces:
Interface:
config:
filename: k8s_clientset.go
mockname: K8sClientsetInterface
20 changes: 1 addition & 19 deletions master/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,25 +88,7 @@ stream-gen: $(STREAM_PYTHON_CLIENT) $(STREAM_TS_CLIENT)
mocks: build/mock_gen.stamp

build/mock_gen.stamp: $(MOCK_INPUTS)
mockery --quiet --name=DB --dir=internal/db --output internal/mocks --filename db.go
mockery --quiet --name=Resources --dir=internal/sproto --output internal/mocks --filename resources.go
mockery --quiet --name=UserAuthZ --dir=internal/user --output internal/mocks --filename user_authz_iface.go
mockery --quiet --name=WorkspaceAuthZ --dir=internal/workspace --output internal/mocks --filename workspace_authz_iface.go
mockery --quiet --name=ProjectAuthZ --dir=internal/project --output internal/mocks --filename project_authz_iface.go
mockery --quiet --name=ExperimentAuthZ --dir=internal/experiment --output internal/mocks --filename authz_experiment_iface.go
mockery --quiet --name=NSCAuthZ --dir=internal/command --output internal/mocks --filename nsc_authz_iface.go
mockery --quiet --name=ModelAuthZ --dir=internal/model --output internal/mocks --filename authz_model_iface.go
mockery --quiet --name=PodInterface --srcpkg=k8s.io/client-go/kubernetes/typed/core/v1 --output internal/mocks --filename pod_iface.go
mockery --quiet --name=EventInterface --srcpkg=k8s.io/client-go/kubernetes/typed/core/v1 --output internal/mocks --filename event_iface.go
mockery --quiet --name=NodeInterface --srcpkg=k8s.io/client-go/kubernetes/typed/core/v1 --output internal/mocks --filename node_iface.go
mockery --quiet --name=JobInterface --srcpkg=k8s.io/client-go/kubernetes/typed/batch/v1 --output internal/mocks --filename job_iface.go
mockery --quiet --name=ResourceManager --dir=internal/rm --output internal/mocks --filename rm.go
mockery --quiet --name=AllocationService --dir=internal/task --output internal/mocks/allocationmocks --filename allocation_service.go --outpkg allocationmocks
mockery --quiet --name=ResourceManagerAuthZ --dir=internal/rm --output internal/mocks --filename rm_authz_iface.go
mockery --quiet --name=Interface --output internal/mocks --srcpkg "k8s.io/client-go/kubernetes" --filename k8s_clientset.go --structname K8sClientsetInterface
mockery --quiet --name=CoreV1Interface --output internal/mocks --srcpkg "k8s.io/client-go/kubernetes/typed/core/v1" --filename k8s_corev1_iface.go --structname K8sCoreV1Interface
mockery --quiet --name=BatchV1Interface --output internal/mocks --srcpkg "k8s.io/client-go/kubernetes/typed/batch/v1" --filename k8s_batchv1_iface.go --structname K8sBatchV1Interface

mockery --config "./.mockery.yaml"
mkdir -p build
touch $@

Expand Down

0 comments on commit ca03da1

Please sign in to comment.