Don't run slow tests in Rust CI, only RA CI
This commit is contained in:
parent
44f50c5fd2
commit
107e2653a6
@ -396,6 +396,10 @@ impl Step for RustAnalyzer {
|
|||||||
// https://github.com/rust-analyzer/expect-test/issues/33
|
// https://github.com/rust-analyzer/expect-test/issues/33
|
||||||
cargo.env("CARGO_WORKSPACE_DIR", &dir);
|
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.add_rustc_lib_path(builder, compiler);
|
||||||
cargo.arg("--").args(builder.config.cmd.test_args());
|
cargo.arg("--").args(builder.config.cmd.test_args());
|
||||||
|
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
|
|
||||||
#![warn(rust_2018_idioms, unused_lifetimes, semicolon_in_expressions_from_macros)]
|
#![warn(rust_2018_idioms, unused_lifetimes, semicolon_in_expressions_from_macros)]
|
||||||
|
|
||||||
|
mod assert_linear;
|
||||||
pub mod bench_fixture;
|
pub mod bench_fixture;
|
||||||
mod fixture;
|
mod fixture;
|
||||||
mod assert_linear;
|
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
collections::BTreeMap,
|
collections::BTreeMap,
|
||||||
@ -391,7 +391,8 @@ fn main() {
|
|||||||
/// also creates a file at `./target/.slow_tests_cookie` which serves as a flag
|
/// also creates a file at `./target/.slow_tests_cookie` which serves as a flag
|
||||||
/// that slow tests did run.
|
/// that slow tests did run.
|
||||||
pub fn skip_slow_tests() -> bool {
|
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 {
|
if should_skip {
|
||||||
eprintln!("ignoring slow test");
|
eprintln!("ignoring slow test");
|
||||||
} else {
|
} 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<(), ()> {
|
pub fn try_ensure_file_contents(file: &Path, contents: &str) -> Result<(), ()> {
|
||||||
match std::fs::read_to_string(file) {
|
match std::fs::read_to_string(file) {
|
||||||
Ok(old_contents) if normalize_newlines(&old_contents) == normalize_newlines(contents) => {
|
Ok(old_contents) if normalize_newlines(&old_contents) == normalize_newlines(contents) => {
|
||||||
return Ok(())
|
return Ok(());
|
||||||
}
|
}
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user