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

Add test to validate the config loading rules #5515

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ytmimi
Copy link
Contributor

@ytmimi ytmimi commented Aug 22, 2022

Closes #5471

Test that configs are loaded in the following order:

  1. Load configs from the --config-path option
  2. Travers the directory hierarchy looking for a config file
  3. Check the user's HOME directory for a config file
  4. Check the user's config directory for a config file

Probably best to review this PR 1 commit at a time.

The `tempfile` crate can help us set up temporary directories used for
testing, and the `tmp_env` crate can help us set temporary environment
variables when testing.
Configs are loaded in the following order:
1. Load configs from the `--config-path` option
2. Travers the directory hierarchy looking for a config file
3. Check the user's `HOME` directory for a config file
4. Check the user's config directory for a config file
use the `serial_test` crate to explicity allow rustfmt integration tests
to run in parallel or in series.

Becuase the `test_load_config_logic` test updates the working directory
while it's running other tests should't be allowed to run at the same
time as it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

imports_granularity not working on global config file
1 participant