Skip to content
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

StepFunctions: Various upgrades #8396

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions moto/core/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from moto.utilities.distutils_version import LooseVersion

PYTHON_VERSION_INFO = sys.version_info
PYTHON_39 = sys.version_info >= (3, 9)
PYTHON_311 = sys.version_info >= (3, 11)
RESPONSES_VERSION = version("responses")
WERKZEUG_VERSION = version("werkzeug")
Expand Down
11 changes: 6 additions & 5 deletions moto/stepfunctions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def __init__(
}
self.loggingConfiguration = loggingConfiguration or {"level": "OFF"}
self.tracingConfiguration = tracingConfiguration or {"enabled": False}
self.sm_type = "STANDARD" # or express

def start_execution(
self,
Expand Down Expand Up @@ -271,15 +272,15 @@ def __init__(
)
self.execution_arn = execution_arn
self.name = execution_name
self.start_date = iso_8601_datetime_with_milliseconds()
self.start_date = datetime.now()
self.state_machine_arn = state_machine_arn
self.execution_input = execution_input
self.status = (
"RUNNING"
if settings.get_sf_execution_history_type() == "SUCCESS"
else "FAILED"
)
self.stop_date: Optional[str] = None
self.stop_date: Optional[datetime] = None
self.account_id = account_id
self.region_name = region_name
self.output: Optional[str] = None
Expand Down Expand Up @@ -388,7 +389,7 @@ def get_execution_history(self, roleArn: str) -> List[Dict[str, Any]]:

def stop(self, *args: Any, **kwargs: Any) -> None:
self.status = "ABORTED"
self.stop_date = iso_8601_datetime_with_milliseconds()
self.stop_date = datetime.now()


class StepFunctionBackend(BaseBackend):
Expand Down Expand Up @@ -644,7 +645,7 @@ def describe_execution(self, execution_arn: str) -> Execution:
)
return exctn

def get_execution_history(self, execution_arn: str) -> List[Dict[str, Any]]:
def get_execution_history(self, execution_arn: str) -> Dict[str, Any]:
self._validate_execution_arn(execution_arn)
state_machine = self._get_state_machine_for_execution(execution_arn)
execution = next(
Expand All @@ -655,7 +656,7 @@ def get_execution_history(self, execution_arn: str) -> List[Dict[str, Any]]:
raise ExecutionDoesNotExist(
"Execution Does Not Exist: '" + execution_arn + "'"
)
return execution.get_execution_history(state_machine.roleArn)
return {"events": execution.get_execution_history(state_machine.roleArn)}

def describe_state_machine_for_execution(self, execution_arn: str) -> StateMachine:
for sm in self.state_machines:
Expand Down
2 changes: 1 addition & 1 deletion moto/stepfunctions/parser/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
In-memory ASL (Amazon StepFunctions Language) parser.

Created for Localstack by @mepalma (https://github.com/MEPalma)
Created for Localstack by @mepalma (https://github.com/MEPalma). Latest commit: 235a06a07ee04a84e02e656f0924a8f4ea2e96a8
Loading
Loading