Skip to content

Commit

Permalink
clean up raylet client mocks (ray-project#32216)
Browse files Browse the repository at this point in the history
Signed-off-by: Clarence Ng <[email protected]>

Remove redundant mock classes. We just need one mock class for the interface that covers all the sub interface. The mock for the sub interface is unused

Signed-off-by: Edward Oakes <[email protected]>
  • Loading branch information
clarng authored and edoakes committed Mar 22, 2023
1 parent 8d90f70 commit be26568
Showing 1 changed file with 0 additions and 118 deletions.
118 changes: 0 additions & 118 deletions src/mock/ray/raylet_client/raylet_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,124 +14,6 @@

namespace ray {

class MockPinObjectsInterface : public PinObjectsInterface {
public:
MOCK_METHOD(void,
PinObjectIDs,
(const rpc::Address &caller_address,
const std::vector<ObjectID> &object_ids,
const ObjectID &generator_id,
const ray::rpc::ClientCallback<ray::rpc::PinObjectIDsReply> &callback),
(override));
};

} // namespace ray

namespace ray {

class MockWorkerLeaseInterface : public WorkerLeaseInterface {
public:
MOCK_METHOD(
void,
RequestWorkerLease,
(const rpc::TaskSpec &task_spec,
bool grant_or_reject,
const ray::rpc::ClientCallback<ray::rpc::RequestWorkerLeaseReply> &callback,
const int64_t backlog_size,
const bool is_selected_based_on_locality),
(override));
MOCK_METHOD(ray::Status,
ReturnWorker,
(int worker_port,
const WorkerID &worker_id,
bool disconnect_worker,
bool worker_exiting),
(override));
MOCK_METHOD(void,
ReleaseUnusedWorkers,
(const std::vector<WorkerID> &workers_in_use,
const rpc::ClientCallback<rpc::ReleaseUnusedWorkersReply> &callback),
(override));
MOCK_METHOD(void,
CancelWorkerLease,
(const TaskID &task_id,
const rpc::ClientCallback<rpc::CancelWorkerLeaseReply> &callback),
(override));
MOCK_METHOD(void,
GetTaskFailureCause,
(const TaskID &task_id,
const rpc::ClientCallback<rpc::GetTaskFailureCauseReply> &callback),
(override));
};

} // namespace ray

namespace ray {

class MockResourceReserveInterface : public ResourceReserveInterface {
public:
MOCK_METHOD(
void,
PrepareBundleResources,
(const std::vector<std::shared_ptr<const BundleSpecification>> &bundle_specs,
const ray::rpc::ClientCallback<ray::rpc::PrepareBundleResourcesReply> &callback),
(override));
MOCK_METHOD(
void,
CommitBundleResources,
(const std::vector<std::shared_ptr<const BundleSpecification>> &bundle_specs,
const ray::rpc::ClientCallback<ray::rpc::CommitBundleResourcesReply> &callback),
(override));
MOCK_METHOD(
void,
CancelResourceReserve,
(const BundleSpecification &bundle_spec,
const ray::rpc::ClientCallback<ray::rpc::CancelResourceReserveReply> &callback),
(override));
MOCK_METHOD(void,
ReleaseUnusedBundles,
(const std::vector<rpc::Bundle> &bundles_in_use,
const rpc::ClientCallback<rpc::ReleaseUnusedBundlesReply> &callback),
(override));
};

} // namespace ray

namespace ray {

class MockDependencyWaiterInterface : public DependencyWaiterInterface {
public:
MOCK_METHOD(ray::Status,
WaitForDirectActorCallArgs,
(const std::vector<rpc::ObjectReference> &references, int64_t tag),
(override));
};

} // namespace ray

namespace ray {

class MockResourceTrackingInterface : public ResourceTrackingInterface {
public:
MOCK_METHOD(void,
UpdateResourceUsage,
(std::string & serialized_resource_usage_batch,
const rpc::ClientCallback<rpc::UpdateResourceUsageReply> &callback),
(override));
MOCK_METHOD(void,
RequestResourceReport,
(const rpc::ClientCallback<rpc::RequestResourceReportReply> &callback),
(override));
MOCK_METHOD(void,
GetResourceLoad,
(const rpc::ClientCallback<rpc::GetResourceLoadReply> &callback),
(override));
};

} // namespace ray

namespace ray {

class MockRayletClientInterface : public RayletClientInterface {
public:
MOCK_METHOD(ray::Status,
Expand Down

0 comments on commit be26568

Please sign in to comment.