Add basic get_execution_history implementation for Step Functions (#3507)

* Add format command to makefile

* Refactor executions to be a attribute of StateMachine

* Begin to add tests for execution history

* Add tests for failed and successful event histories, with implementations

* Add failure case to environment var check

* Skip test if in server mode and update implementation coverage

* Add conditional import for mock to cover python 2

* Refactor stop execution logic into StateMachine

* Refactor event history environment variable into settings.py

* Remove typing and os import
This commit is contained in:
Ciaran Evans 2020-12-03 18:32:06 +00:00 committed by GitHub
commit 48df5bd5af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 383 additions and 46 deletions

View file

@ -4,3 +4,12 @@ TEST_SERVER_MODE = os.environ.get("TEST_SERVER_MODE", "0").lower() == "true"
INITIAL_NO_AUTH_ACTION_COUNT = float(
os.environ.get("INITIAL_NO_AUTH_ACTION_COUNT", float("inf"))
)
def get_sf_execution_history_type():
"""
Determines which execution history events `get_execution_history` returns
:returns: str representing the type of Step Function Execution Type events should be
returned. Default value is SUCCESS, currently supports (SUCCESS || FAILURE)
"""
return os.environ.get("SF_EXECUTION_HISTORY_TYPE", "SUCCESS")