SFN: list_executions() now returns the StopDate-attribute (#6802)
This commit is contained in:
parent
03cc785615
commit
de4ce26c20
@ -141,6 +141,7 @@ class StepFunctionResponse(BaseResponse):
|
||||
"executionArn": execution.execution_arn,
|
||||
"name": execution.name,
|
||||
"startDate": execution.start_date,
|
||||
"stopDate": execution.stop_date,
|
||||
"stateMachineArn": state_machine.arn,
|
||||
"status": execution.status,
|
||||
}
|
||||
|
@ -758,15 +758,22 @@ def test_state_machine_throws_error_when_describing_unknown_execution():
|
||||
def test_state_machine_stop_execution():
|
||||
client = boto3.client("stepfunctions", region_name=region)
|
||||
#
|
||||
sm = client.create_state_machine(
|
||||
sm_arn = client.create_state_machine(
|
||||
name="name", definition=str(simple_definition), roleArn=_get_default_role()
|
||||
)
|
||||
start = client.start_execution(stateMachineArn=sm["stateMachineArn"])
|
||||
)["stateMachineArn"]
|
||||
start = client.start_execution(stateMachineArn=sm_arn)
|
||||
stop = client.stop_execution(executionArn=start["executionArn"])
|
||||
#
|
||||
assert stop["ResponseMetadata"]["HTTPStatusCode"] == 200
|
||||
assert isinstance(stop["stopDate"], datetime)
|
||||
|
||||
description = client.describe_execution(executionArn=start["executionArn"])
|
||||
assert description["status"] == "ABORTED"
|
||||
assert isinstance(description["stopDate"], datetime)
|
||||
|
||||
execution = client.list_executions(stateMachineArn=sm_arn)["executions"][0]
|
||||
assert isinstance(execution["stopDate"], datetime)
|
||||
|
||||
|
||||
@mock_stepfunctions
|
||||
@mock_sts
|
||||
@ -786,22 +793,6 @@ def test_state_machine_stop_raises_error_when_unknown_execution():
|
||||
assert "Execution Does Not Exist:" in ex.value.response["Error"]["Message"]
|
||||
|
||||
|
||||
@mock_stepfunctions
|
||||
@mock_sts
|
||||
def test_state_machine_describe_execution_after_stoppage():
|
||||
client = boto3.client("stepfunctions", region_name=region)
|
||||
sm = client.create_state_machine(
|
||||
name="name", definition=str(simple_definition), roleArn=_get_default_role()
|
||||
)
|
||||
execution = client.start_execution(stateMachineArn=sm["stateMachineArn"])
|
||||
client.stop_execution(executionArn=execution["executionArn"])
|
||||
description = client.describe_execution(executionArn=execution["executionArn"])
|
||||
#
|
||||
assert description["ResponseMetadata"]["HTTPStatusCode"] == 200
|
||||
assert description["status"] == "ABORTED"
|
||||
assert isinstance(description["stopDate"], datetime)
|
||||
|
||||
|
||||
@mock_stepfunctions
|
||||
@mock_sts
|
||||
def test_state_machine_get_execution_history_throws_error_with_unknown_execution():
|
||||
|
Loading…
Reference in New Issue
Block a user