-
Notifications
You must be signed in to change notification settings - Fork 49
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
Fix Checkbox configuration value resolution and add Metabox scenarios to test it #439
Fix Checkbox configuration value resolution and add Metabox scenarios to test it #439
Conversation
Launcher should always take precedence over anything else (config file from /etc/xdg/ or ~/.config/). In order to achieve this, it has to be added last in the configs list to be processed.
Checkbox configuration covers many different sections. In order to accomodate testing all the different sections inside the same "tag" ("config"), refactoring the existing tests (covering the [environment] section) into its own scenario module.
I have found a corner case where this (seems) to not work. Creating [test selection]
forced = yes Checkbox remote seems to ignore the configuration. Is this related to what was changed here? |
@@ -68,6 +67,9 @@ def load_configs(launcher_file=None): | |||
config = expand_all(os.path.join(d, config_filename)) | |||
if os.path.exists(config): | |||
configs.append(config) | |||
# Add config from launcher last so it gets precedence over others | |||
if launcher_file: | |||
configs.append(launcher_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record, the ConfigParser read() works this way:
It is possible to read several configurations into a single ConfigParser, where the most recently added configuration has the highest priority. Any conflicting keys are taken from the more recent configuration while the previously existing keys are retained.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the config test directory reorganization, it helps a lot to separate the various files involved to validate each section.
Description
This PR provides several changes:
[environment]
section testing using Metabox scenarios[test selection]
section of Checkbox configPlease check individual commit messages for more information.
Resolved issues
CHECKBOX-436
Tests