Skip to content

Commit e427c15

Browse files
committed
Remove some prints. Add simple test that confirms start_batch_operation is wired up through bridge and core
1 parent 2812a80 commit e427c15

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

scripts/gen_bridge_client.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ def service_name(s):
6161
)
6262
)
6363

64-
print(f"successfully generated client at {output_file}")
65-
6664

6765
def generate_python_service(service_descriptor: ServiceDescriptor) -> str:
6866
service_template = Template("""
@@ -158,12 +156,8 @@ def generate_rust_client_impl(
158156
with open(output_file, "w") as f:
159157
f.write(impl_template.substitute(service_calls="\n".join(service_calls)))
160158

161-
print(f"successfully generated client at {output_file}")
162-
163159

164160
def generate_rust_service_call(service_descriptor: ServiceDescriptor) -> str:
165-
print(f"generating rpc call wrapper for {service_descriptor.full_name}")
166-
167161
call_template = Template("""
168162
fn call_${service_name}<'p>(
169163
&self,

tests/test_client.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333
WorkflowTaskFailedCause,
3434
)
3535
from temporalio.api.history.v1 import History
36-
from temporalio.api.workflowservice.v1 import GetSystemInfoRequest
36+
from temporalio.api.workflowservice.v1 import GetSystemInfoRequest, request_response_pb2
37+
from temporalio.api.batch.v1 import message_pb2
38+
from temporalio.api.enums.v1 import reset_pb2
3739
from temporalio.client import (
3840
BuildIdOpAddNewCompatible,
3941
BuildIdOpAddNewDefault,
@@ -1552,3 +1554,22 @@ async def get_schedule_result() -> Tuple[int, Optional[str]]:
15521554
)
15531555

15541556
await handle.delete()
1557+
1558+
1559+
async def test_workflow_client_start_batch_operation(client: Client):
1560+
# This test is used to ensure that the start_batch_operation is wired through
1561+
# the layers of python -> bridge python -> bridge rust -> core
1562+
# https://github.com/temporalio/sdk-python/issues/927
1563+
1564+
request = request_response_pb2.StartBatchOperationRequest(
1565+
namespace="default",
1566+
visibility_query='WorkflowType="test_workflow"',
1567+
job_id=f"batch-reset-{int(datetime.now().timestamp())}",
1568+
reason="test",
1569+
reset_operation=message_pb2.BatchOperationReset(
1570+
reset_type=reset_pb2.RESET_TYPE_LAST_WORKFLOW_TASK
1571+
),
1572+
)
1573+
1574+
response = await client.workflow_service.start_batch_operation(request)
1575+
assert response is not None

0 commit comments

Comments
 (0)