-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Some tests will fail if one have a local git config user.name/user.email #7469
Comments
I have a local |
I'm able to repro it pretty easily by running |
Sorry, but I don't quite understand this instructions at all... |
Oh, I see. I'm saved because my build tree is off in the weeds on another partition (I do this to keep build artifacts out of my backups). |
Add a special case for git config discovery inside tests Fixes #7469: Some tests will fail if one have a local git config user.name/user.email
Fix test escaping __CARGO_TEST_ROOT #8886 added a test which unsets `__CARGO_TEST_ROOT`, but that environment variable is there for a reason. This causes problems as it causes that test to load the `.cargo/config` from the real home directory, which if it contains a `[cargo-new]` section, causes the test to fail. The fix here is to change `find_tests_git_config` so that it behaves more like the real git config loader, but avoids escaping the test sandbox. There are some subtle issues here, like #7469, which I believe should still work correctly.
Problem
Running
cargo test --all
will fail if you have a local.git/config
. Link to the log file is here https://gist.github.com/hbina/8b09995b55e95267b3286a99a30a54f2Specifically, the following unit tests will fail.
Steps
user.name
and/oruser.email
Possible Solution(s)
@ehuss suggested a solution that uses the environment variable
__CARGO_TEST_ROOT
. The following is my attempt to use that. This code could be infinitely better, I guess. Note that this does not actually solve the problem, but some variations of them work (except for one test). I think the problem is with my logic.Notes
Output of
cargo version
:cargo 1.38.0 (23ef9a4ef 2019-08-20)
The text was updated successfully, but these errors were encountered: