Skip to content

Commit f744680

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

7 files changed

+92
-6
lines changed

tests/nexus/test_dynamic_creation_of_user_handler_classes.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from temporalio import nexus, workflow
99
from temporalio.client import Client
1010
from temporalio.nexus._util import get_operation_factory
11+
from temporalio.testing import WorkflowEnvironment
1112
from temporalio.worker import Worker
1213
from tests.helpers.nexus import create_nexus_endpoint
1314

@@ -69,7 +70,11 @@ def increment(self) -> nexusrpc.handler.OperationHandler[int, int]:
6970

7071
async def test_run_nexus_service_from_programmatically_created_service_handler(
7172
client: Client,
73+
env: WorkflowEnvironment,
7274
):
75+
if env.supports_time_skipping:
76+
pytest.skip("Nexus tests don't work with time-skipping server")
77+
7378
task_queue = str(uuid.uuid4())
7479

7580
service_handler = nexusrpc.handler._core.ServiceHandler(

tests/nexus/test_handler.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,9 @@ async def test_start_operation_happy_path(
562562
with_service_definition: bool,
563563
env: WorkflowEnvironment,
564564
):
565+
if env.supports_time_skipping:
566+
pytest.skip("Nexus tests don't work with time-skipping server")
567+
565568
if with_service_definition:
566569
await _test_start_operation_with_service_definition(test_case, env)
567570
else:
@@ -582,6 +585,9 @@ async def test_start_operation_happy_path(
582585
async def test_start_operation_protocol_level_failures(
583586
test_case: Type[_TestCase], env: WorkflowEnvironment
584587
):
588+
if env.supports_time_skipping:
589+
pytest.skip("Nexus tests don't work with time-skipping server")
590+
585591
await _test_start_operation_with_service_definition(test_case, env)
586592

587593

@@ -596,6 +602,9 @@ async def test_start_operation_protocol_level_failures(
596602
async def test_start_operation_operation_failures(
597603
test_case: Type[_TestCase], env: WorkflowEnvironment
598604
):
605+
if env.supports_time_skipping:
606+
pytest.skip("Nexus tests don't work with time-skipping server")
607+
599608
await _test_start_operation_with_service_definition(test_case, env)
600609

601610

@@ -722,6 +731,9 @@ class AsyncHandlerHappyPathWithoutTypeAnnotations(_TestCase):
722731
async def test_start_operation_without_type_annotations(
723732
test_case: Type[_TestCase], env: WorkflowEnvironment
724733
):
734+
if env.supports_time_skipping:
735+
pytest.skip("Nexus tests don't work with time-skipping server")
736+
725737
if test_case.skip:
726738
pytest.skip(test_case.skip)
727739
task_queue = str(uuid.uuid4())
@@ -765,6 +777,9 @@ def test_operation_without_type_annotations_without_service_definition_raises_va
765777

766778

767779
async def test_logger_uses_operation_context(env: WorkflowEnvironment, caplog: Any):
780+
if env.supports_time_skipping:
781+
pytest.skip("Nexus tests don't work with time-skipping server")
782+
768783
task_queue = str(uuid.uuid4())
769784
service_name = MyService.__name__
770785
operation_name = "log"
@@ -923,6 +938,9 @@ async def test_handler_instantiation(
923938

924939

925940
async def test_cancel_operation_with_invalid_token(env: WorkflowEnvironment):
941+
if env.supports_time_skipping:
942+
pytest.skip("Nexus tests don't work with time-skipping server")
943+
926944
"""Verify that canceling an operation with an invalid token fails correctly."""
927945
task_queue = str(uuid.uuid4())
928946
endpoint = (await create_nexus_endpoint(task_queue, env.client)).endpoint.id
@@ -953,6 +971,9 @@ async def test_cancel_operation_with_invalid_token(env: WorkflowEnvironment):
953971
async def test_request_id_is_received_by_sync_operation(
954972
env: WorkflowEnvironment,
955973
):
974+
if env.supports_time_skipping:
975+
pytest.skip("Nexus tests don't work with time-skipping server")
976+
956977
task_queue = str(uuid.uuid4())
957978
endpoint = (await create_nexus_endpoint(task_queue, env.client)).endpoint.id
958979
service_client = ServiceClient(
@@ -1019,6 +1040,9 @@ async def operation_that_executes_a_workflow_before_starting_the_backing_workflo
10191040

10201041

10211042
async def test_request_id_becomes_start_workflow_request_id(env: WorkflowEnvironment):
1043+
if env.supports_time_skipping:
1044+
pytest.skip("Nexus tests don't work with time-skipping server")
1045+
10221046
# We send two Nexus requests that would start a workflow with the same workflow ID,
10231047
# using reuse_policy=REJECT_DUPLICATE. This would fail if they used different
10241048
# request IDs. However, when we use the same request ID, it does not fail,

tests/nexus/test_handler_async_operation.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ async def test_async_operation_lifecycle(
144144
Type[MyServiceHandlerWithNonAsyncDefs],
145145
],
146146
):
147+
if env.supports_time_skipping:
148+
pytest.skip("Nexus tests don't work with time-skipping server")
149+
147150
task_executor = await TaskExecutor.connect()
148151
task_queue = str(uuid.uuid4())
149152
endpoint = (await create_nexus_endpoint(task_queue, env.client)).endpoint.id

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(

tests/nexus/test_workflow_run_operation.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ async def test_workflow_run_operation(
9090
env: WorkflowEnvironment,
9191
service_handler_cls: Type[Any],
9292
):
93+
if env.supports_time_skipping:
94+
pytest.skip("Nexus tests don't work with time-skipping server")
95+
9396
task_queue = str(uuid.uuid4())
9497
endpoint = (await create_nexus_endpoint(task_queue, env.client)).endpoint.id
9598
assert (service_defn := nexusrpc.get_service_definition(service_handler_cls))

0 commit comments

Comments
 (0)