|
47 | 47 | ) |
48 | 48 | from temporalio.nexus import WorkflowRunOperationContext, workflow_run_operation |
49 | 49 | from temporalio.service import RPCError, RPCStatusCode |
| 50 | +from temporalio.testing import WorkflowEnvironment |
50 | 51 | from temporalio.worker import Worker |
51 | 52 | from tests.helpers.nexus import create_nexus_endpoint, make_nexus_endpoint_name |
52 | 53 |
|
@@ -443,11 +444,15 @@ async def run( |
443 | 444 | ) |
444 | 445 | async def test_sync_response( |
445 | 446 | client: Client, |
| 447 | + env: WorkflowEnvironment, |
446 | 448 | exception_in_operation_start: bool, |
447 | 449 | request_cancel: bool, |
448 | 450 | op_definition_type: OpDefinitionType, |
449 | 451 | caller_reference: CallerReference, |
450 | 452 | ): |
| 453 | + if env.supports_time_skipping: |
| 454 | + pytest.skip("Nexus tests don't work with time-skipping server") |
| 455 | + |
451 | 456 | task_queue = str(uuid.uuid4()) |
452 | 457 | async with Worker( |
453 | 458 | client, |
@@ -514,11 +519,15 @@ async def test_sync_response( |
514 | 519 | ) |
515 | 520 | async def test_async_response( |
516 | 521 | client: Client, |
| 522 | + env: WorkflowEnvironment, |
517 | 523 | exception_in_operation_start: bool, |
518 | 524 | request_cancel: bool, |
519 | 525 | op_definition_type: OpDefinitionType, |
520 | 526 | caller_reference: CallerReference, |
521 | 527 | ): |
| 528 | + if env.supports_time_skipping: |
| 529 | + pytest.skip("Nexus tests don't work with time-skipping server") |
| 530 | + |
522 | 531 | task_queue = str(uuid.uuid4()) |
523 | 532 | async with Worker( |
524 | 533 | client, |
@@ -669,11 +678,15 @@ async def _start_wf_and_nexus_op( |
669 | 678 | @pytest.mark.parametrize("response_type", [SyncResponse, AsyncResponse]) |
670 | 679 | async def test_untyped_caller( |
671 | 680 | client: Client, |
| 681 | + env: WorkflowEnvironment, |
672 | 682 | exception_in_operation_start: bool, |
673 | 683 | op_definition_type: OpDefinitionType, |
674 | 684 | caller_reference: CallerReference, |
675 | 685 | response_type: ResponseType, |
676 | 686 | ): |
| 687 | + if env.supports_time_skipping: |
| 688 | + pytest.skip("Nexus tests don't work with time-skipping server") |
| 689 | + |
677 | 690 | task_queue = str(uuid.uuid4()) |
678 | 691 | async with Worker( |
679 | 692 | client, |
@@ -830,7 +843,12 @@ async def run( |
830 | 843 | # TODO(nexus-prerelease): check missing decorator behavior |
831 | 844 |
|
832 | 845 |
|
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 | + |
834 | 852 | # Note that: |
835 | 853 | # - The caller can specify the service & operation via a reference to either the |
836 | 854 | # interface or implementation class. |
@@ -956,7 +974,11 @@ async def run(self, input: str, task_queue: str) -> str: |
956 | 974 |
|
957 | 975 | async def test_workflow_run_operation_can_execute_workflow_before_starting_backing_workflow( |
958 | 976 | client: Client, |
| 977 | + env: WorkflowEnvironment, |
959 | 978 | ): |
| 979 | + if env.supports_time_skipping: |
| 980 | + pytest.skip("Nexus tests don't work with time-skipping server") |
| 981 | + |
960 | 982 | task_queue = str(uuid.uuid4()) |
961 | 983 | async with Worker( |
962 | 984 | client, |
@@ -1222,7 +1244,12 @@ async def run(self, op: str, input: OverloadTestValue) -> OverloadTestValue: |
1222 | 1244 | "by_name_multi_param", |
1223 | 1245 | ], |
1224 | 1246 | ) |
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 | + |
1226 | 1253 | task_queue = str(uuid.uuid4()) |
1227 | 1254 | async with Worker( |
1228 | 1255 | client, |
|
0 commit comments