File tree 1 file changed +29
-0
lines changed
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ import uuid
2
+
3
+ import pytest
4
+ from temporalio .client import Client , WorkflowExecutionStatus
5
+ from temporalio .testing import WorkflowEnvironment
6
+ from temporalio .worker import Worker
7
+
8
+ from hello .hello_update import GreetingWorkflow
9
+
10
+
11
+ async def test_update_workflow (client : Client , env : WorkflowEnvironment ):
12
+ if env .supports_time_skipping :
13
+ pytest .skip (
14
+ "Time-skipping test server currently has issue with update: https://github.com/temporalio/sdk-java/issues/1903"
15
+ )
16
+ task_queue_name = str (uuid .uuid4 ())
17
+ async with Worker (client , task_queue = task_queue_name , workflows = [GreetingWorkflow ]):
18
+ handle = await client .start_workflow (
19
+ GreetingWorkflow .run , id = str (uuid .uuid4 ()), task_queue = task_queue_name
20
+ )
21
+
22
+ assert WorkflowExecutionStatus .RUNNING == (await handle .describe ()).status
23
+
24
+ update_result = await handle .execute_update (
25
+ GreetingWorkflow .update_workflow_status
26
+ )
27
+ assert "Workflow status updated" == update_result
28
+ assert "Hello, World!" == (await handle .result ())
29
+ assert WorkflowExecutionStatus .COMPLETED == (await handle .describe ()).status
You can’t perform that action at this time.
0 commit comments