Skip to content

Commit

Permalink
StepFunctions: Various upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
bblommers committed Dec 15, 2024
1 parent 3866eb0 commit bf58f41
Show file tree
Hide file tree
Showing 239 changed files with 39,931 additions and 20,462 deletions.
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

0 comments on commit bf58f41

Please sign in to comment.