Skip to content

Ensure postAction and taskTeardown tasks get called after action failure#227

Merged
devblackops merged 1 commit intomasterfrom
fix/postaction-taskteardown
Nov 12, 2017
Merged

Ensure postAction and taskTeardown tasks get called after action failure#227
devblackops merged 1 commit intomasterfrom
fix/postaction-taskteardown

Conversation

@devblackops
Copy link
Copy Markdown
Member

Description

Replacement for old PR #74. This change ensures that if postAction or taskTearDown tasks are defined, they will always be called.

From @stephan-dowding in #74:

A quick patch to fix a little bug bear of mine...
I normally expect things like PostAction and TearDown to be called even if the main Action has failed. This is because it is natural for me to use things like PreAction and SetUp to reserve resources and setup the environment for the Action. I will then use PostAction and TearDown to release those resources and wind down the environment. Having all that stuff hanging around after a test failure was extremely annoying!
I know I could have used try...finally within my Action blocks, but these constructs felt like the natural and intended place for them, hence the pull request!

Related Issue

N/A

Motivation and Context

PostAction and TaskTeardown tasks should get called regardless of the main action succeeding or not.

How Has This Been Tested?

Ran through specs.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@devblackops devblackops added this to the v4.7.0 milestone Nov 11, 2017
@devblackops devblackops self-assigned this Nov 11, 2017
@devblackops devblackops merged commit 4e1011b into master Nov 12, 2017
@HeyItsGilbert HeyItsGilbert deleted the fix/postaction-taskteardown branch September 21, 2024 17:24
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.

1 participant