Skip to content

Test cases should not modify the host system #2345

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

Closed
Stebalien opened this issue Feb 1, 2016 · 4 comments
Closed

Test cases should not modify the host system #2345

Stebalien opened this issue Feb 1, 2016 · 4 comments

Comments

@Stebalien
Copy link
Contributor

Currently, some of the test cases modify the git config (e.g. finds_author_git in tests/test_cargo_new.rs). This is not nice 😢.

@alexcrichton
Copy link
Member

It's a bug that this test is modifying global configuration, the reset of $HOME should in theory tell git where it should be modifying this. Does git read some other environment variables to figure out where the global configuration should go?

@Stebalien
Copy link
Contributor Author

It uses XDG_CONFIG_HOME. The test suite should also set GIT_CONFIG_NOSYSTEM.

According to the manual

GIT_CONFIG_NOSYSTEM
Whether to skip reading settings from the system-wide $(prefix)/etc/gitconfig file. This environment variable can be used along with $HOME and $XDG_CONFIG_HOME to create a predictable environment for a picky script, or you can set it temporarily to avoid using a buggy /etc/gitconfig file while waiting for someone with sufficient permissions to fix it.

@alexcrichton
Copy link
Member

Whelp

alexcrichton added a commit to alexcrichton/cargo that referenced this issue Feb 1, 2016
* Remove the XDG_CONFIG_HOME environment variable as we're resetting HOME
* Add GIT_CONFIG_NOSYSTEM to encourage git to not read that configuration

Closes rust-lang#2345
bors added a commit that referenced this issue Feb 1, 2016
* Remove the XDG_CONFIG_HOME environment variable as we're resetting HOME
* Add GIT_CONFIG_NOSYSTEM to encourage git to not read that configuration

Closes #2345
@bors bors closed this as completed in #2347 Feb 1, 2016
@Stebalien
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants