1
Fork 0

ci: Further tone down the test verbosity.

When `--quiet` is passed to rustbuild, suppress rustdoc test output unless
failure.

Added a `--quiet` flag to `tidy`, which suppresses the features table.

The actual `--quiet` flag is enabled in #42354.

Since details of failed tests will still be printed, and the name of slow
tests taking >60 to runtime will also be printed, the debugging difficulty
caused by information loss should be minimal; but it is very worthwhile to
keep the log under 10000 lines on Travis CI so that common errors can be
spotted without reading the raw log.
This commit is contained in:
kennytm 2017-05-22 04:27:47 +08:00
parent 1222b7a9d1
commit 6ac0787ff3
No known key found for this signature in database
GPG key ID: FEF6C8051D0E013C
3 changed files with 16 additions and 7 deletions

View file

@ -132,6 +132,9 @@ pub fn tidy(build: &Build, host: &str) {
if !build.config.vendor { if !build.config.vendor {
cmd.arg("--no-vendor"); cmd.arg("--no-vendor");
} }
if build.config.quiet_tests {
cmd.arg("--quiet");
}
build.run(&mut cmd); build.run(&mut cmd);
} }
@ -355,13 +358,14 @@ fn markdown_test(build: &Build, compiler: &Compiler, markdown: &Path) {
cmd.arg(markdown); cmd.arg(markdown);
cmd.env("RUSTC_BOOTSTRAP", "1"); cmd.env("RUSTC_BOOTSTRAP", "1");
let mut test_args = build.flags.cmd.test_args().join(" "); let test_args = build.flags.cmd.test_args().join(" ");
if build.config.quiet_tests {
test_args.push_str(" --quiet");
}
cmd.arg("--test-args").arg(test_args); cmd.arg("--test-args").arg(test_args);
build.run(&mut cmd); if build.config.quiet_tests {
build.run_quiet(&mut cmd);
} else {
build.run(&mut cmd);
}
} }
/// Run all unit tests plus documentation tests for an entire crate DAG defined /// Run all unit tests plus documentation tests for an entire crate DAG defined

View file

@ -49,7 +49,7 @@ pub struct Feature {
pub has_gate_test: bool, pub has_gate_test: bool,
} }
pub fn check(path: &Path, bad: &mut bool) { pub fn check(path: &Path, bad: &mut bool, quiet: bool) {
let mut features = collect_lang_features(path); let mut features = collect_lang_features(path);
assert!(!features.is_empty()); assert!(!features.is_empty());
@ -134,6 +134,10 @@ pub fn check(path: &Path, bad: &mut bool) {
if *bad { if *bad {
return; return;
} }
if quiet {
println!("* {} features", features.len());
return;
}
let mut lines = Vec::new(); let mut lines = Vec::new();
for (name, feature) in features.iter() { for (name, feature) in features.iter() {

View file

@ -57,11 +57,12 @@ fn main() {
let args: Vec<String> = env::args().skip(1).collect(); let args: Vec<String> = env::args().skip(1).collect();
let mut bad = false; let mut bad = false;
let quiet = args.iter().any(|s| *s == "--quiet");
bins::check(&path, &mut bad); bins::check(&path, &mut bad);
style::check(&path, &mut bad); style::check(&path, &mut bad);
errors::check(&path, &mut bad); errors::check(&path, &mut bad);
cargo::check(&path, &mut bad); cargo::check(&path, &mut bad);
features::check(&path, &mut bad); features::check(&path, &mut bad, quiet);
pal::check(&path, &mut bad); pal::check(&path, &mut bad);
unstable_book::check(&path, &mut bad); unstable_book::check(&path, &mut bad);
if !args.iter().any(|s| *s == "--no-vendor") { if !args.iter().any(|s| *s == "--no-vendor") {