-
Notifications
You must be signed in to change notification settings - Fork 74
adds test example for hello_update.py #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
26502e0
adds test example for hello_update.py
yashvanzara 03e41fe
fix: test name and await for result
yashvanzara fa58de1
Merge branch 'main' into hello_update-test
yashvanzara 565c8e0
Merge branch 'main' into hello_update-test
cretz 8288b75
Merge branch 'main' into hello_update-test
yashvanzara b0c35bd
fix: skip update test when time-skipping is enabled
yashvanzara 00931a0
fix: add imports for time-skipping server check
yashvanzara File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import uuid | ||
|
||
import pytest | ||
from temporalio.client import Client, WorkflowExecutionStatus | ||
from temporalio.testing import WorkflowEnvironment | ||
from temporalio.worker import Worker | ||
|
||
from hello.hello_update import GreetingWorkflow | ||
|
||
|
||
async def test_update_workflow(client: Client, env: WorkflowEnvironment): | ||
if env.supports_time_skipping: | ||
pytest.skip( | ||
"Time-skipping test server currently has issue with update: https://github.com/temporalio/sdk-java/issues/1903" | ||
) | ||
task_queue_name = str(uuid.uuid4()) | ||
async with Worker(client, task_queue=task_queue_name, workflows=[GreetingWorkflow]): | ||
handle = await client.start_workflow( | ||
GreetingWorkflow.run, id=str(uuid.uuid4()), task_queue=task_queue_name | ||
) | ||
|
||
assert WorkflowExecutionStatus.RUNNING == (await handle.describe()).status | ||
|
||
update_result = await handle.execute_update( | ||
GreetingWorkflow.update_workflow_status | ||
) | ||
assert "Workflow status updated" == update_result | ||
assert "Hello, World!" == (await handle.result()) | ||
assert WorkflowExecutionStatus.COMPLETED == (await handle.describe()).status | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.