[SWF] runId should be optional (#5670)

This commit is contained in:
Alexandru Ciucă 2022-11-16 12:40:38 +02:00 committed by GitHub
parent d6b4b9718d
commit e410347520
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions

View File

@ -542,7 +542,7 @@ class SWFResponse(BaseResponse):
signal_name = self._params["signalName"]
workflow_id = self._params["workflowId"]
_input = self._params["input"]
run_id = self._params["runId"]
run_id = self._params.get("runId")
self._check_string(domain_name)
self._check_string(signal_name)

View File

@ -69,6 +69,31 @@ def test_signal_workflow_execution_boto3():
wfe["openCounts"]["openDecisionTasks"].should.equal(2)
@mock_swf
def test_signal_workflow_execution_without_runId():
conn = setup_swf_environment_boto3()
hsh = conn.start_workflow_execution(
domain="test-domain",
workflowId="uid-abcd1234",
workflowType={"name": "test-workflow", "version": "v1.0"},
)
run_id = hsh["runId"]
conn.signal_workflow_execution(
domain="test-domain",
signalName="my_signal",
workflowId="uid-abcd1234",
input="my_input",
)
resp = conn.get_workflow_execution_history(
domain="test-domain", execution={"runId": run_id, "workflowId": "uid-abcd1234"}
)
types = [evt["eventType"] for evt in resp["events"]]
types.should.contain("WorkflowExecutionSignaled")
@mock_swf
def test_start_already_started_workflow_execution_boto3():
client = setup_swf_environment_boto3()