Skip to content

Commit 969c12d

Browse files
committed
Sort and organize the env_remove list.
1 parent 7ddcf0f commit 969c12d

File tree

1 file changed

+17
-16
lines changed
  • crates/cargo-test-support/src

1 file changed

+17
-16
lines changed

crates/cargo-test-support/src/lib.rs

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,28 +1234,29 @@ pub trait TestEnv: Sized {
12341234
.env("__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS", "stable")
12351235
// Keeps cargo within its sandbox.
12361236
.env("__CARGO_TEST_DISABLE_GLOBAL_KNOWN_HOST", "1")
1237-
// For now disable incremental by default as support hasn't ridden to the
1238-
// stable channel yet. Once incremental support hits the stable compiler we
1239-
// can switch this to one and then fix the tests.
1237+
// Incremental generates a huge amount of data per test, which we
1238+
// don't particularly need. Tests that specifically need to check
1239+
// the incremental behavior should turn this back on.
12401240
.env("CARGO_INCREMENTAL", "0")
1241+
// Don't read the system git config which is out of our control.
1242+
.env("GIT_CONFIG_NOSYSTEM", "1")
12411243
.env_remove("__CARGO_DEFAULT_LIB_METADATA")
1242-
.env_remove("RUSTC")
1243-
.env_remove("RUSTDOC")
1244-
.env_remove("RUSTC_WRAPPER")
1245-
.env_remove("RUSTFLAGS")
1246-
.env_remove("RUSTDOCFLAGS")
1247-
.env_remove("XDG_CONFIG_HOME") // see #2345
1248-
.env("GIT_CONFIG_NOSYSTEM", "1") // keep trying to sandbox ourselves
12491244
.env_remove("EMAIL")
1250-
.env_remove("USER") // not set on some rust-lang docker images
1251-
.env_remove("MFLAGS")
1252-
.env_remove("MAKEFLAGS")
1253-
.env_remove("GIT_AUTHOR_NAME")
12541245
.env_remove("GIT_AUTHOR_EMAIL")
1255-
.env_remove("GIT_COMMITTER_NAME")
1246+
.env_remove("GIT_AUTHOR_NAME")
12561247
.env_remove("GIT_COMMITTER_EMAIL")
1248+
.env_remove("GIT_COMMITTER_NAME")
1249+
.env_remove("MAKEFLAGS")
1250+
.env_remove("MFLAGS")
1251+
.env_remove("MSYSTEM") // assume cmd.exe everywhere on windows
1252+
.env_remove("RUSTC")
1253+
.env_remove("RUSTC_WRAPPER")
1254+
.env_remove("RUSTDOC")
1255+
.env_remove("RUSTDOCFLAGS")
1256+
.env_remove("RUSTFLAGS")
12571257
.env_remove("SSH_AUTH_SOCK") // ensure an outer agent is never contacted
1258-
.env_remove("MSYSTEM"); // assume cmd.exe everywhere on windows
1258+
.env_remove("USER") // not set on some rust-lang docker images
1259+
.env_remove("XDG_CONFIG_HOME"); // see #2345
12591260
if cfg!(target_os = "macos") {
12601261
// Work-around a bug in macOS 10.15, see `link_or_copy` for details.
12611262
self = self.env("__CARGO_COPY_DONT_LINK_DO_NOT_USE_THIS", "1");

0 commit comments

Comments
 (0)