Skip to content

Commit

Permalink
ci: Further tone down the test verbosity.
Browse files Browse the repository at this point in the history
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 rust-lang#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.
  • Loading branch information
kennytm committed Jun 1, 2017
1 parent 1222b7a commit 6ac0787
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
14 changes: 9 additions & 5 deletions src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ pub fn tidy(build: &Build, host: &str) {
if !build.config.vendor {
cmd.arg("--no-vendor");
}
if build.config.quiet_tests {
cmd.arg("--quiet");
}
build.run(&mut cmd);
}

Expand Down Expand Up @@ -355,13 +358,14 @@ fn markdown_test(build: &Build, compiler: &Compiler, markdown: &Path) {
cmd.arg(markdown);
cmd.env("RUSTC_BOOTSTRAP", "1");

let mut test_args = build.flags.cmd.test_args().join(" ");
if build.config.quiet_tests {
test_args.push_str(" --quiet");
}
let test_args = build.flags.cmd.test_args().join(" ");
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
Expand Down
6 changes: 5 additions & 1 deletion src/tools/tidy/src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub struct Feature {
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);
assert!(!features.is_empty());

Expand Down Expand Up @@ -134,6 +134,10 @@ pub fn check(path: &Path, bad: &mut bool) {
if *bad {
return;
}
if quiet {
println!("* {} features", features.len());
return;
}

let mut lines = Vec::new();
for (name, feature) in features.iter() {
Expand Down
3 changes: 2 additions & 1 deletion src/tools/tidy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ fn main() {
let args: Vec<String> = env::args().skip(1).collect();

let mut bad = false;
let quiet = args.iter().any(|s| *s == "--quiet");
bins::check(&path, &mut bad);
style::check(&path, &mut bad);
errors::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);
unstable_book::check(&path, &mut bad);
if !args.iter().any(|s| *s == "--no-vendor") {
Expand Down

0 comments on commit 6ac0787

Please sign in to comment.