Skip to content

Ensuring postAction and tearDown gets called on Action failure#74

Closed
stephan-dowding wants to merge 3 commits intopsake:masterfrom
stephan-dowding:master
Closed

Ensuring postAction and tearDown gets called on Action failure#74
stephan-dowding wants to merge 3 commits intopsake:masterfrom
stephan-dowding:master

Conversation

@stephan-dowding
Copy link
Copy Markdown

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!

@damianh
Copy link
Copy Markdown
Contributor

damianh commented Mar 31, 2014

I'm interested in pulling this, but will need some specs to back it up.

@stephan-dowding
Copy link
Copy Markdown
Author

Sorry for the delay!!
I've added a couple of specs, but I can't really see a way to make them more convincing without overhauling the spec library.

@ghost
Copy link
Copy Markdown

ghost commented May 8, 2017

Is there an update on this pull request? I would very much like this functionality also.

@devblackops
Copy link
Copy Markdown
Member

@stephan-dowding This looks good to me but given the age of this, there are some conflicts with the existing PR. I'm going to create a new one and include your changes.

@devblackops
Copy link
Copy Markdown
Member

Creating new PR #227 which is up to date with psake. Closing this one out. Thanks @stephan-dowding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants