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

Add teardown actions and stable action order #169

Closed
arcivanov opened this Issue Aug 31, 2015 · 0 comments

Comments

Projects
None yet
2 participants
@arcivanov
Contributor

arcivanov commented Aug 31, 2015

There is a need to cleanup around tasks. For example there has to be a way to start a server, run integration tests and stop the server if a failure occurs. Not being able to stop a server leaves processes hanging around, requires a cleanup and makes it very hard to debug failures.

Therefore:

  1. Add an attribute to @after, called teardown. The attribute is False by default.
    • If an exception occurs anywhere in @before or in a task or in any of the @after actions, the exception is recorded, then all @after actions with teardown=True are executed
    • While executing teardown @after actions, the errors raised therein are suppressed. The executing actions log their errors without raising them.
    • Once all teardown @after actions are executed the originating error is raised.
  2. Use ordered dictionaries in ExecutionManager to make sure that the order the actions are registered in is the order that actions are executed in. This is important to ensure that behaviors are predictable as far as cleanup order.

@arcivanov arcivanov self-assigned this Aug 31, 2015

arcivanov added a commit to arcivanov/pybuilder that referenced this issue Aug 31, 2015

Add unit tests as well
fixes #169, connected to #169

arcivanov added a commit to arcivanov/pybuilder that referenced this issue Aug 31, 2015

Add finalizer actions and stable action order #169
Add unit tests as well

fixes #169, connected to #169

arcivanov added a commit to arcivanov/pybuilder that referenced this issue Aug 31, 2015

Add finalizer actions and stable action order #169
Add unit tests as well

fixes #169, connected to #169

arcivanov added a commit to arcivanov/pybuilder that referenced this issue Sep 4, 2015

Add finalizer actions and stable action order #169
Add unit tests as well

fixes #169, connected to #169

arcivanov added a commit to arcivanov/pybuilder that referenced this issue Sep 5, 2015

Add finalizer actions and stable action order #169
Add unit and integration tests

fixes #169, connected to #169

arcivanov added a commit to arcivanov/pybuilder that referenced this issue Sep 5, 2015

Add teardown actions and stable action order #169
Add unit and integration tests

fixes #169, connected to #169

@arcivanov arcivanov changed the title from Add finalizer actions and stable action order to Add teardown actions and stable action order Sep 5, 2015

arcivanov added a commit to arcivanov/pybuilder that referenced this issue Sep 5, 2015

Add teardown actions and stable action order #169
Add unit and integration tests

fixes #169, connected to #169

@mriehl mriehl closed this in #170 Sep 7, 2015

@mriehl mriehl removed the in progress label Sep 7, 2015

mriehl added a commit that referenced this issue Sep 7, 2015

Merge pull request #170 from arcivanov/issue_169
Add teardown actions and stable action order #169
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment