Skip to content

Conversation

@kunigami
Copy link
Contributor

@kunigami kunigami commented Feb 4, 2026

Summary:
Refactored the remote function client to use dependency injection, enabling proper mocking in tests:

  1. Added IRemoteFunctionClient abstract interface in ThriftClient.h with invokeFunction() method
  2. Added ThriftRemoteFunctionClient default implementation that wraps the actual thrift client
  3. Added RemoteFunctionClientFactory type alias for creating clients
  4. Added optional clientFactory field to RemoteThriftVectorFunctionMetadata
  5. Modified RemoteThriftFunction to use injected factory (with fallback to default)
  6. Added MockRemoteFunctionTest test fixture demonstrating mock client usage
  7. Added 3 new tests using mock clients instead of real thrift server

This allows tests to inject mock clients instead of requiring a real thrift server, making tests faster and more isolated.

Differential Revision: D92213049

@netlify
Copy link

netlify bot commented Feb 4, 2026

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 1775307
🔍 Latest deploy log https://app.netlify.com/projects/meta-velox/deploys/6982aa64f0b83a000811c1d5

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 4, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 4, 2026

@kunigami has exported this pull request. If you are a Meta employee, you can view the originating Diff in D92213049.

kunigami pushed a commit to kunigami/velox that referenced this pull request Feb 4, 2026
…ebookincubator#16231)

Summary:

Refactored the remote function client to use dependency injection, enabling proper mocking in tests:

1. Added `IRemoteFunctionClient` abstract interface in ThriftClient.h with `invokeFunction()` method
2. Added `ThriftRemoteFunctionClient` default implementation that wraps the actual thrift client
3. Added `RemoteFunctionClientFactory` type alias for creating clients
4. Added optional `clientFactory` field to `RemoteThriftVectorFunctionMetadata`
5. Modified `RemoteThriftFunction` to use injected factory (with fallback to default)
6. Added `MockRemoteFunctionTest` test fixture demonstrating mock client usage
7. Added 3 new tests using mock clients instead of real thrift server

This allows tests to inject mock clients instead of requiring a real thrift server, making tests faster and more isolated.

Differential Revision: D92213049
…ebookincubator#16231)

Summary:

Refactored the remote function client to use dependency injection, enabling proper mocking in tests:

1. Added `IRemoteFunctionClient` abstract interface in ThriftClient.h with `invokeFunction()` method
2. Added `ThriftRemoteFunctionClient` default implementation that wraps the actual thrift client
3. Added `RemoteFunctionClientFactory` type alias for creating clients
4. Added optional `clientFactory` field to `RemoteThriftVectorFunctionMetadata`
5. Modified `RemoteThriftFunction` to use injected factory (with fallback to default)
6. Added `MockRemoteFunctionTest` test fixture demonstrating mock client usage
7. Added 3 new tests using mock clients instead of real thrift server

This allows tests to inject mock clients instead of requiring a real thrift server, making tests faster and more isolated.

Differential Revision: D92213049
Copy link
Contributor

@xiaoxmeng xiaoxmeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kunigami LGTM. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants