about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-07-26 22:42:38 -0400
committerGitHub <noreply@github.com>2025-07-26 22:42:38 -0400
commit2c0a33178190ff4e577afda2b89a535c4dc2dcf8 (patch)
treec14b56f89d9c7fb26f367f10d8c63e86dc003f32
parente04daf98f145bd8b6d64ef11884503d600043ca6 (diff)
parent3dac888c866ad76e43e6e7fa664805e009570eb4 (diff)
downloadrust-2c0a33178190ff4e577afda2b89a535c4dc2dcf8.tar.gz
rust-2c0a33178190ff4e577afda2b89a535c4dc2dcf8.zip
Rollup merge of #144464 - Kobzol:x-test-default, r=jieyouxu
Only run bootstrap tests in `x test` on CI

Discussed at https://rust-lang.zulipchat.com/#narrow/channel/122652-new-members/topic/Linux.20Distribution/with/530839642. The bootstrap tests can be sensitive of the environment where they are executed. And now that they are executed very early in the test pipeline, it can be annoying for people who just try to do `x test` when it fails on bootstrap tests.

We could move the bootstrap tests back to the end of the `x test` pipeline, but then it would just fail later. I'd prefer to only run them on CI by default.

Fixes: https://github.com/rust-lang/rust/issues/143973
-rw-r--r--src/bootstrap/src/core/build_steps/test.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs
index ebbb569e9db..0f9268097d7 100644
--- a/src/bootstrap/src/core/build_steps/test.rs
+++ b/src/bootstrap/src/core/build_steps/test.rs
@@ -3132,7 +3132,11 @@ impl Step for Bootstrap {
     }
 
     fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
-        run.path("src/bootstrap")
+        // Bootstrap tests might not be perfectly self-contained and can depend on the external
+        // environment, submodules that are checked out, etc.
+        // Therefore we only run them by default on CI.
+        let runs_on_ci = run.builder.config.is_running_on_ci;
+        run.path("src/bootstrap").default_condition(runs_on_ci)
     }
 
     fn make_run(run: RunConfig<'_>) {