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

Step Functions - basic method implementation #2409

Merged
merged 5 commits into from
Sep 24, 2019

Conversation

bblommers
Copy link
Collaborator

Hi,
A first attempt at the implementation for Step Functions.

The start_execution does not do anything at the moment - don't know whether it's achievable/recommendable to actually execute the underlying activities/lambdas, considering it's supposed to be a mock?

Right now it just creates a static Execution object that is 'Running', until you manually stop() it.

In my (limited) experience, the State Machine was set up as part of the infrastructure.
Subsequent method calls would only call start_execution, so the test setup would look like this:

def before():
  create_state_machine(definition:'NOOP')

@mock_stepfunctions
def test():
  method_under_test()
  assert state_machine was executed

def method_under_test():
  client.start_execution(state_machine)

This doesn't test the actual definition of course. Ideally we at least validate the provided JSON - but that would require some more work.

LMKWYT

@coveralls
Copy link

coveralls commented Sep 4, 2019

Coverage Status

Coverage increased (+0.07%) to 93.325% when pulling 38455c8 on bblommers:feature/stepfunctions into 3a5d857 on spulec:master.

@bblommers
Copy link
Collaborator Author

@spulec If you have some time, would appreciate some guidance on why the tests are failing in Travis. Works fine locally, in both server modes..

@spulec
Copy link
Collaborator

spulec commented Sep 24, 2019

It looks like the issues are coming from stepfunctions/models.py:L162 (identity = sts.get_caller_identity()). Instead of creating a boto client, you can try importing the STS backend directly.

@bblommers
Copy link
Collaborator Author

Thanks @spulec - that did the trick

@spulec spulec merged commit 9cc6a15 into getmoto:master Sep 24, 2019
@spulec
Copy link
Collaborator

spulec commented Sep 24, 2019

Looks great; thanks!

@bblommers
Copy link
Collaborator Author

FYI @kilsbo and @estherthetester
start_execution is effectively a no-op at the moment, but it's a start!

@bblommers bblommers deleted the feature/stepfunctions branch October 23, 2019 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants