about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAmos Wenger <amoswenger@gmail.com>2022-07-22 18:16:46 +0200
committerAmos Wenger <amoswenger@gmail.com>2022-07-24 10:38:19 +0200
commit107e2653a6fa15ff9761302f86b2bdf8c8cc8147 (patch)
tree84d8f70bb0acc698b9144d295da54ce96fc5e018 /src
parent44f50c5fd275dfe7260d6eea5065e12eb3c8e811 (diff)
downloadrust-107e2653a6fa15ff9761302f86b2bdf8c8cc8147.tar.gz
rust-107e2653a6fa15ff9761302f86b2bdf8c8cc8147.zip
Don't run slow tests in Rust CI, only RA CI
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/test.rs4
-rw-r--r--src/tools/rust-analyzer/crates/test-utils/src/lib.rs7
2 files changed, 8 insertions, 3 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 0fa9671738e..c2c45355694 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -396,6 +396,10 @@ impl Step for RustAnalyzer {
         // https://github.com/rust-analyzer/expect-test/issues/33
         cargo.env("CARGO_WORKSPACE_DIR", &dir);
 
+        // RA's test suite tries to write to the source directory, that can't
+        // work in Rust CI
+        cargo.env("SKIP_SLOW_TESTS", "1");
+
         cargo.add_rustc_lib_path(builder, compiler);
         cargo.arg("--").args(builder.config.cmd.test_args());
 
diff --git a/src/tools/rust-analyzer/crates/test-utils/src/lib.rs b/src/tools/rust-analyzer/crates/test-utils/src/lib.rs
index dedfbd7afef..8a9cfb6c22e 100644
--- a/src/tools/rust-analyzer/crates/test-utils/src/lib.rs
+++ b/src/tools/rust-analyzer/crates/test-utils/src/lib.rs
@@ -8,9 +8,9 @@
 
 #![warn(rust_2018_idioms, unused_lifetimes, semicolon_in_expressions_from_macros)]
 
+mod assert_linear;
 pub mod bench_fixture;
 mod fixture;
-mod assert_linear;
 
 use std::{
     collections::BTreeMap,
@@ -391,7 +391,8 @@ fn main() {
 /// also creates a file at `./target/.slow_tests_cookie` which serves as a flag
 /// that slow tests did run.
 pub fn skip_slow_tests() -> bool {
-    let should_skip = std::env::var("CI").is_err() && std::env::var("RUN_SLOW_TESTS").is_err();
+    let should_skip = (std::env::var("CI").is_err() && std::env::var("RUN_SLOW_TESTS").is_err())
+        || std::env::var("SKIP_SLOW_TESTS").is_ok();
     if should_skip {
         eprintln!("ignoring slow test");
     } else {
@@ -475,7 +476,7 @@ pub fn ensure_file_contents(file: &Path, contents: &str) {
 pub fn try_ensure_file_contents(file: &Path, contents: &str) -> Result<(), ()> {
     match std::fs::read_to_string(file) {
         Ok(old_contents) if normalize_newlines(&old_contents) == normalize_newlines(contents) => {
-            return Ok(())
+            return Ok(());
         }
         _ => (),
     }