-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
Deprecate subcontexts #518
Comments
I've not dug into subcontext discovery but I know a bit about plugin discovery. How that works is that the plugin files are found based on a path, and then plugins from uninstalled modules are discarded. Knowing what's installed or not does require a Drupal bootstrap (because you need the configuration) but maybe path based discovery doesn't? And maybe we don't mind loading contexts from uninstalled modules that are still present in the codebase, it's not ideal but not a disaster. |
I would prefer to keep them if possible. Or at least if it needs to be reworked keep the principle of automatically making a set of step definitions available as soon as a module is enabled. I think it is very handy and we use this extensively in our custom modules. |
I have changed my mind on this matter. I've been thinking about it the last couple of months and I've grown convinced that modules should in fact NOT provide step definitions that activated automatically when the module is enabled. A module can only provide step definitions that use the business language of the module authors. For example if the Taxonomy module would provide step definitions then it will be natural for them to use business language that uses words like "taxonomy", "vocabulary" etc. This won't necessarily match the business language of a project's client: they might call them "hashtags" or "labels". I think this problem makes the usefulness of subcontexts very limited in general. I am using subcontexts heavily in my custom project, but we could just as well use normal context classes, and list them in the I think the best practice for a module to provide Behat integration would be to:
Deprecating subcontexts is fine for me. |
I've been thinking about ways to resolve #487 and one thought is to re-work how sub-context discovery happens, or since it isn't a much used feature, deprecate it in favor of just manually specifying where to search for additional steps (this is already supported).
The text was updated successfully, but these errors were encountered: