Description
🤔 What's the problem you've observed?
Cucumber can be configured via the CLI and files, but not via environment variables (except the publish
functionality which does support some).
This means users that configure most of their other stuff with environment variables often have a sort of frankenstein setup, with some stuff living in the Cucumber config (maybe in profiles) and other somewhat related stuff sitting elsewhere (e.g. in .env
files).
✨ Do you have a proposal for making it better?
Support configuring Cucumber via environment variables.
When resolving configuration, each option should be sought from environment variables by converting its key to uppercase-with-underscores format, prefixing with CUCUMBER_OPTION_
, and then checking the environment for that key. So for example, retryTagFilter
would be expressed as CUCUMBER_RETRY_TAG_FILTER
and so on.
TBA on how things like booleans and arrays should be expressed and parsed. We should follow conventions set by other tools if they exist.
Environment variables should take precedence over the configuration file and default, but not over the CLI, which "wins" because it's been passed directly in the command. All options should maintain their current merge vs overwrite behaviour.
Profile-level options are out of scope.
📚 Any additional context?
See conversation on #2346.
This text was originally generated from a template, then edited by hand. You can modify the template here.