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

Commits on Aug 22, 2022

  1. Add tempfile and tmp_env as dev dependencies

    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.
    ytmimi committed Aug 22, 2022
    Configuration menu
    Copy the full SHA
    1b5f8ef View commit details
    Browse the repository at this point in the history
  2. Add test to validate the config loading rules

    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
    ytmimi committed Aug 22, 2022
    Configuration menu
    Copy the full SHA
    b1061a8 View commit details
    Browse the repository at this point in the history
  3. Prevent tests from running at the same as test_load_config_logic

    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.
    ytmimi committed Aug 22, 2022
    Configuration menu
    Copy the full SHA
    d8077b2 View commit details
    Browse the repository at this point in the history