Skip to content

Commit f72c5db

Browse files
committed
Skip tests under Java test server
1 parent 3783ac5 commit f72c5db

File tree

3 files changed

+57
-6
lines changed

3 files changed

+57
-6
lines changed

tests/nexus/test_workflow_caller.py

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
)
4848
from temporalio.nexus import WorkflowRunOperationContext, workflow_run_operation
4949
from temporalio.service import RPCError, RPCStatusCode
50+
from temporalio.testing import WorkflowEnvironment
5051
from temporalio.worker import Worker
5152
from tests.helpers.nexus import create_nexus_endpoint, make_nexus_endpoint_name
5253

@@ -443,11 +444,15 @@ async def run(
443444
)
444445
async def test_sync_response(
445446
client: Client,
447+
env: WorkflowEnvironment,
446448
exception_in_operation_start: bool,
447449
request_cancel: bool,
448450
op_definition_type: OpDefinitionType,
449451
caller_reference: CallerReference,
450452
):
453+
if env.supports_time_skipping:
454+
pytest.skip("Nexus tests don't work with time-skipping server")
455+
451456
task_queue = str(uuid.uuid4())
452457
async with Worker(
453458
client,
@@ -514,11 +519,15 @@ async def test_sync_response(
514519
)
515520
async def test_async_response(
516521
client: Client,
522+
env: WorkflowEnvironment,
517523
exception_in_operation_start: bool,
518524
request_cancel: bool,
519525
op_definition_type: OpDefinitionType,
520526
caller_reference: CallerReference,
521527
):
528+
if env.supports_time_skipping:
529+
pytest.skip("Nexus tests don't work with time-skipping server")
530+
522531
task_queue = str(uuid.uuid4())
523532
async with Worker(
524533
client,
@@ -669,11 +678,15 @@ async def _start_wf_and_nexus_op(
669678
@pytest.mark.parametrize("response_type", [SyncResponse, AsyncResponse])
670679
async def test_untyped_caller(
671680
client: Client,
681+
env: WorkflowEnvironment,
672682
exception_in_operation_start: bool,
673683
op_definition_type: OpDefinitionType,
674684
caller_reference: CallerReference,
675685
response_type: ResponseType,
676686
):
687+
if env.supports_time_skipping:
688+
pytest.skip("Nexus tests don't work with time-skipping server")
689+
677690
task_queue = str(uuid.uuid4())
678691
async with Worker(
679692
client,
@@ -830,7 +843,12 @@ async def run(
830843
# TODO(nexus-prerelease): check missing decorator behavior
831844

832845

833-
async def test_service_interface_and_implementation_names(client: Client):
846+
async def test_service_interface_and_implementation_names(
847+
client: Client, env: WorkflowEnvironment
848+
):
849+
if env.supports_time_skipping:
850+
pytest.skip("Nexus tests don't work with time-skipping server")
851+
834852
# Note that:
835853
# - The caller can specify the service & operation via a reference to either the
836854
# interface or implementation class.
@@ -956,7 +974,11 @@ async def run(self, input: str, task_queue: str) -> str:
956974

957975
async def test_workflow_run_operation_can_execute_workflow_before_starting_backing_workflow(
958976
client: Client,
977+
env: WorkflowEnvironment,
959978
):
979+
if env.supports_time_skipping:
980+
pytest.skip("Nexus tests don't work with time-skipping server")
981+
960982
task_queue = str(uuid.uuid4())
961983
async with Worker(
962984
client,
@@ -1222,7 +1244,12 @@ async def run(self, op: str, input: OverloadTestValue) -> OverloadTestValue:
12221244
"by_name_multi_param",
12231245
],
12241246
)
1225-
async def test_workflow_run_operation_overloads(client: Client, op: str):
1247+
async def test_workflow_run_operation_overloads(
1248+
client: Client, env: WorkflowEnvironment, op: str
1249+
):
1250+
if env.supports_time_skipping:
1251+
pytest.skip("Nexus tests don't work with time-skipping server")
1252+
12261253
task_queue = str(uuid.uuid4())
12271254
async with Worker(
12281255
client,

tests/nexus/test_workflow_caller_error_chains.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
ApplicationError,
2121
NexusOperationError,
2222
)
23+
from temporalio.testing import WorkflowEnvironment
2324
from temporalio.worker import Worker
2425
from tests.helpers.nexus import create_nexus_endpoint, make_nexus_endpoint_name
2526

@@ -398,8 +399,11 @@ async def invoke_nexus_op_and_assert_error(self, input: ErrorTestInput) -> None:
398399

399400
@pytest.mark.parametrize("test_case", list(error_conversion_test_cases.values()))
400401
async def test_errors_raised_by_nexus_operation(
401-
client: Client, test_case: type[ErrorConversionTestCase]
402+
client: Client, env: WorkflowEnvironment, test_case: type[ErrorConversionTestCase]
402403
):
404+
if env.supports_time_skipping:
405+
pytest.skip("Nexus tests don't work with time-skipping server")
406+
403407
task_queue = str(uuid.uuid4())
404408
async with Worker(
405409
client,

tests/nexus/test_workflow_caller_errors.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
NexusOperationError,
3232
TimeoutError,
3333
)
34+
from temporalio.testing import WorkflowEnvironment
3435
from temporalio.worker import Worker
3536
from tests.helpers import assert_eq_eventually
3637
from tests.helpers.nexus import create_nexus_endpoint, make_nexus_endpoint_name
@@ -107,7 +108,12 @@ async def run(self, input: ErrorTestInput) -> None:
107108
"retried_due_to_internal_handler_error",
108109
],
109110
)
110-
async def test_nexus_operation_is_retried(client: Client, operation_name: str):
111+
async def test_nexus_operation_is_retried(
112+
client: Client, env: WorkflowEnvironment, operation_name: str
113+
):
114+
if env.supports_time_skipping:
115+
pytest.skip("Nexus tests don't work with time-skipping server")
116+
111117
input = ErrorTestInput(
112118
service_name="ErrorTestService",
113119
operation_name=operation_name,
@@ -154,10 +160,14 @@ async def times_called() -> int:
154160
)
155161
async def test_nexus_operation_fails_without_retry_as_handler_error(
156162
client: Client,
163+
env: WorkflowEnvironment,
157164
operation_name: str,
158165
handler_error_type: nexusrpc.HandlerErrorType,
159166
handler_error_message: str,
160167
):
168+
if env.supports_time_skipping:
169+
pytest.skip("Nexus tests don't work with time-skipping server")
170+
161171
input = ErrorTestInput(
162172
service_name=(
163173
"ErrorTestService"
@@ -224,7 +234,12 @@ async def run(self) -> None:
224234
)
225235

226236

227-
async def test_error_raised_by_timeout_of_nexus_start_operation(client: Client):
237+
async def test_error_raised_by_timeout_of_nexus_start_operation(
238+
client: Client, env: WorkflowEnvironment
239+
):
240+
if env.supports_time_skipping:
241+
pytest.skip("Nexus tests don't work with time-skipping server")
242+
228243
task_queue = str(uuid.uuid4())
229244
async with Worker(
230245
client,
@@ -302,7 +317,12 @@ async def run(self) -> None:
302317
await op_handle
303318

304319

305-
async def test_error_raised_by_timeout_of_nexus_cancel_operation(client: Client):
320+
async def test_error_raised_by_timeout_of_nexus_cancel_operation(
321+
client: Client, env: WorkflowEnvironment
322+
):
323+
if env.supports_time_skipping:
324+
pytest.skip("Nexus tests don't work with time-skipping server")
325+
306326
pytest.skip("TODO(nexus-prerelease): finish writing this test")
307327
task_queue = str(uuid.uuid4())
308328
async with Worker(

0 commit comments

Comments
 (0)