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

Allow the ProcessHandler's scope to be overridden in the XXX-processes.properties #14

Closed
yamaduc opened this issue Nov 9, 2013 · 3 comments
Milestone

Comments

@yamaduc
Copy link
Member

yamaduc commented Nov 9, 2013

The user might want a process to Process to run until all feature files are completed.

E.G. Launch a server, run all tests against it, stop server.

Add the ability to override scope = HandlerScope.MANAGED or scope = HandlerScope.UNMANAGED in the XXX-processes.properties.

@nickebbutt
Copy link
Member

We need to review handler scopes, but I'm not sure the above example should be implemented as a Handler class - probably better as an ExcecutionListener which receives lifecycle events including start() and end() for the whole session. To do this we'd need to add a hook to specify a custom ExecutionListener, which we should really do anyway.

@yamaduc
Copy link
Member Author

yamaduc commented Nov 19, 2013

I see your point.
It would be nice if there was an example on how to write a custom ExecutionListener on the Wiki :-)

@nickebbutt
Copy link
Member

Have thought about this some more and we have decided to enhance scoping for Handler classes to support a feature scope (handler gets created once per feature, reused for scenario). We will also support initialization and destroy methods which are scoped by scenario/feature, so a feature-scoped handler can do some initialization and tear down for individual scenarios as well as feature start/end.

I think the ability to configure a process to be feature scoped would be a nice idea. To support this we can change the ProcessHandler to be feature scoped, and allow a process to be configured as 'feature' or 'scenario' - if scenario then a process will be shut down when the scenario ends, otherwise at the end of the feature.

We are also adding a special 'Feature-Start:" and "Feature-End:" section to the supported syntax - these are special scenarios which perform setup and tear down for a feature and would be a good place to start any feature-scoped processes.

For processes which need to start and stay running for a whole suite of tests, an ExecutionListener would still be the best place to do this, since we won't be supporting any kind of suite scoping, at least for now. We will add the ability to specify a custom ExecutionListener class in the next release.

More on the wiki soon

nickebbutt pushed a commit to nickebbutt/Chorus that referenced this issue Feb 26, 2015
…arent .posts and instead only apply it to .post
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants