-
Notifications
You must be signed in to change notification settings - Fork 42
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
Handle configuration in a consistent manner #138
Comments
To sum up, you can pass options to PropEr, using this methods:
There's no clear order in what overrides what. Edit: |
Maybe this: Order of priority would be 3b, 1, 2 (outer to inner). |
I would be opposed to removing |
That's 5 implemented in |
I like the approach 5 with |
@alfert might not work when running in async mode. A test module with its own |
I need to be more precise, default options is the wrong name. What I meant are global configurations, which are independent from a specific test case (= global) and should be constant over a test run. They are injected by OS environment, mix or application configuration and the like. These settings should be parsed and then stored in the Application Environment centrally such that any evaluation of these global settings can happen independent from the source of injection. In this way we have only place where parsing of parameters and values happens. E.g. encoding of parameter names and values are different if done in mix and by the os environment. |
A test case should never modify the app environment since it is generally not well defined when the values of the environment are read again, since it is used for initiall system configuration.
A config function should be stateless, ie only depend on its parameters and the app env and does not modify any global state (we are functional, after all!)
Von unterwegs gesendet
… Am 05.12.2019 um 10:14 schrieb x4lldux ***@***.***>:
@alfert might not work when running in async mode. A test module with its own default_opts function might override app env config for all other tests. We would need to create some cache, which stores configuration per test process. I'm not sure it's worth it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I'm not sure I understand you correctly. |
Hmm, let me try to explain my thoughts. What I understand from your remarks, that we really need a good semantics how the various levels are detected and how they override each other such that
With this in mind, let us think about the settings
To handle this properly, we need a function for proper merging of three lists of options: per property, per module and the App Env. This is at least partially available in #126. Regarding options on the property and This should also remove the necessity of the process dictionary, since in the property macro the module-local and the global configurations are accessible and the merged options are fed downwards into the property execution. We can provide an undocumented complex data structure for our properly managed options (e.g as tuple: What do you think? |
Currently we have several approaches for handling configuration, mostly for historical reasons. This is ugly and should refactored to a consistent, logical approach.
Sources of configuration are:
Let's discuss approaches!
The text was updated successfully, but these errors were encountered: