Description
Problem
Running cargo test
in the cargo repository fails many tests if the user has set the default branch to something other than master
.
Steps
- git config --global init.defaultBranch dev
- cargo test
- Notice failures
Possible Solution(s)
When using Git in a test suite, it's necessary to set HOME
to a controlled location and to also set GIT_CONFIG_NOSYSTEM
to avoid reading the system configuration file; otherwise, the global or system configuration files can break tests. Cargo probably needs to set these values during setup in the test suite; this is probably not the only configuration option that will have the effect of breaking tests.
Notes
Output of cargo version
:
cargo 1.47.0 (f3c7e066a 2020-08-28)
(Note that this is not the version being tested, about which this report is being made.)
Debian GNU Linux amd64/sid, rustc 1.47.0, cargo repository revision 2af662e.