PROBLEM
Five test files hand-roll a fake ateapipb.ControlClient, across four packages. #907 adds a sixth,
which is what surfaced this. That PR should land as it stands; consolidating these is follow-up
cleanup, not a prerequisite for it.
Surveyed at 3f132c6d (main, 2026-08-17). Links are permalinks pinned to that commit so the line numbers can't drift; the type names are the durable anchor.
The sixth, not yet merged: fakeControlClient in internal/benchmarking/boomer/glutton/fixture_test.go, package glutton, stubbing CreateAtespace, CreateActor, ResumeActor, SuspendActor, DeleteActor.
The two ingress ones live in the same package: the same one-RPC ResumeActor fake under two names. Their struct definitions are identical; only the method bodies differ, and resumerMockClient nil-guards resumeFn where mockClient calls it unconditionally.
All six are unexported and live in _test.go files, so none is importable. All six use the same idiom: embed ateapipb.ControlClient as an anonymous field and override the handful of RPCs the test needs, so calls to any RPC no fake overrides compile and nil-panic at call time.
The union across all six is seven RPCs: CreateAtespace, CreateActor, ResumeActor, SuspendActor, DeleteActor, GetActor, ListActors. ControlClient declares 28, so one embedding fake needs pluggable func fields for just those seven and inherits the rest.
PROPOSAL
An exported fake in a non-_test.go file under repo-root internal/, following the precedent
already set by internal/volume/mock.go:52 (MockVolumePlugin, with NewMockVolumePlugin() at
:55), which cmd/ateapi/internal/controlapi/functional_test.go and controlapi/volumes_test.go already call cross-package.
Placement has to be repo-root internal/: cmd/<app>/internal/... is importable only from under
that cmd/<app>, and pkg/proto/ateapipb is generated. pkg/ would work mechanically but makes a
test fake part of the public API surface. Put it in a dedicated package rather than an existing production one, so only tests link it and it never reaches a shipped binary.
PROBLEM
Five test files hand-roll a fake
ateapipb.ControlClient, across four packages. #907 adds a sixth,which is what surfaced this. That PR should land as it stands; consolidating these is follow-up
cleanup, not a prerequisite for it.
Surveyed at
3f132c6d(main, 2026-08-17). Links are permalinks pinned to that commit so the line numbers can't drift; the type names are the durable anchor.mockControlClientcontrollersactortemplate_controller_test.go:97CreateAtespace,CreateActorhealthControlClientrouterhealth_test.go:41ListActorsmockClientingressingress_test.go:39ResumeActorresumerMockClientingressresumer_test.go:32ResumeActoregressMockClientegressegress_test.go:197GetActorThe sixth, not yet merged:
fakeControlClientininternal/benchmarking/boomer/glutton/fixture_test.go, packageglutton, stubbingCreateAtespace,CreateActor,ResumeActor,SuspendActor,DeleteActor.The two
ingressones live in the same package: the same one-RPCResumeActorfake under two names. Their struct definitions are identical; only the method bodies differ, andresumerMockClientnil-guardsresumeFnwheremockClientcalls it unconditionally.All six are unexported and live in
_test.gofiles, so none is importable. All six use the same idiom: embedateapipb.ControlClientas an anonymous field and override the handful of RPCs the test needs, so calls to any RPC no fake overrides compile and nil-panic at call time.The union across all six is seven RPCs:
CreateAtespace,CreateActor,ResumeActor,SuspendActor,DeleteActor,GetActor,ListActors.ControlClientdeclares 28, so one embedding fake needs pluggable func fields for just those seven and inherits the rest.PROPOSAL
An exported fake in a non-
_test.gofile under repo-rootinternal/, following the precedentalready set by
internal/volume/mock.go:52(MockVolumePlugin, withNewMockVolumePlugin()at:55), whichcmd/ateapi/internal/controlapi/functional_test.goandcontrolapi/volumes_test.goalready call cross-package.Placement has to be repo-root
internal/:cmd/<app>/internal/...is importable only from underthat
cmd/<app>, andpkg/proto/ateapipbis generated.pkg/would work mechanically but makes atest fake part of the public API surface. Put it in a dedicated package rather than an existing production one, so only tests link it and it never reaches a shipped binary.