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

Execute 'after' phase irrespective of the commands success/failure #156

Open
akhilbojedla opened this issue Sep 27, 2019 · 6 comments
Open
Labels
Team Discussion Team Discussion (not ready for pickup yet)

Comments

@akhilbojedla
Copy link
Contributor

Description

In most cases After phase needs to be executed irrespective of whether the commands are executed successfully or not.

For example unset an environment variable (or) cleaning up connections irrespective of the status of execution.

Acceptance Criteria

After phase should be executed irrespective of the status of execution of commands.

@gopinath-langote gopinath-langote added the Team Discussion Team Discussion (not ready for pickup yet) label Sep 30, 2019
@gopinath-langote gopinath-langote added this to To do in Feature Ideas / Bug tracker via automation Sep 30, 2019
@gopinath-langote
Copy link
Owner

@landpro WDYT?

@gopinath-langote
Copy link
Owner

gopinath-langote commented Sep 30, 2019

@akhilbojedla Good point – let's also get some feedback from others

IMHO, stopping build makes more sense - we are not sure for what purpose before is getting used.

We can give a parameter/flag to do it - by default fail and do not continue.

@akhilbojedla
Copy link
Contributor Author

akhilbojedla commented Oct 1, 2019

@gopinath-langote I think otherwise. Generally before and after are used as setting up and cleanup (atleast it is in the most cases I know).

For example popular testing frameworks like Junit executes the methods annotated with @AfterEach, @AferAll irrespective of tests success/failure.

Feature Ideas / Bug tracker automation moved this from To do to Done Oct 1, 2019
@akhilbojedla akhilbojedla reopened this Oct 1, 2019
@gopinath-langote gopinath-langote moved this from Done to To do in Feature Ideas / Bug tracker Oct 1, 2019
@boonwj
Copy link
Contributor

boonwj commented Oct 4, 2019

Perhaps this could be controlled via a field, e.g. execute_after_on_failure: false. The user can then have a choice on their preferred behaviour.

@gopinath-langote
Copy link
Owner

Hello @akhilbojedla I agree with @boonwj

It make sense to parameterise the option to the user. Now there are two ways to do it.

Either pass the exec_after_failure in command line or give this as an option in yaml config itself.

WDYT?

@akhilbojedla
Copy link
Contributor Author

@gopinath-langote Firstly, Apologies for the late reply.

Yes, I think that could be an option. I would personally prefer to do it the other way around though i.e. disabling executing after phase via command-line option and enable it by default. But any option works just fine for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Discussion Team Discussion (not ready for pickup yet)
Projects
Development

No branches or pull requests

3 participants