Skip to content

Commit 6ac0787

Browse files
committed
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.
1 parent 1222b7a commit 6ac0787

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

src/bootstrap/check.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ pub fn tidy(build: &Build, host: &str) {
132132
if !build.config.vendor {
133133
cmd.arg("--no-vendor");
134134
}
135+
if build.config.quiet_tests {
136+
cmd.arg("--quiet");
137+
}
135138
build.run(&mut cmd);
136139
}
137140

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

358-
let mut test_args = build.flags.cmd.test_args().join(" ");
359-
if build.config.quiet_tests {
360-
test_args.push_str(" --quiet");
361-
}
361+
let test_args = build.flags.cmd.test_args().join(" ");
362362
cmd.arg("--test-args").arg(test_args);
363363

364-
build.run(&mut cmd);
364+
if build.config.quiet_tests {
365+
build.run_quiet(&mut cmd);
366+
} else {
367+
build.run(&mut cmd);
368+
}
365369
}
366370

367371
/// Run all unit tests plus documentation tests for an entire crate DAG defined

src/tools/tidy/src/features.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub struct Feature {
4949
pub has_gate_test: bool,
5050
}
5151

52-
pub fn check(path: &Path, bad: &mut bool) {
52+
pub fn check(path: &Path, bad: &mut bool, quiet: bool) {
5353
let mut features = collect_lang_features(path);
5454
assert!(!features.is_empty());
5555

@@ -134,6 +134,10 @@ pub fn check(path: &Path, bad: &mut bool) {
134134
if *bad {
135135
return;
136136
}
137+
if quiet {
138+
println!("* {} features", features.len());
139+
return;
140+
}
137141

138142
let mut lines = Vec::new();
139143
for (name, feature) in features.iter() {

src/tools/tidy/src/main.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,12 @@ fn main() {
5757
let args: Vec<String> = env::args().skip(1).collect();
5858

5959
let mut bad = false;
60+
let quiet = args.iter().any(|s| *s == "--quiet");
6061
bins::check(&path, &mut bad);
6162
style::check(&path, &mut bad);
6263
errors::check(&path, &mut bad);
6364
cargo::check(&path, &mut bad);
64-
features::check(&path, &mut bad);
65+
features::check(&path, &mut bad, quiet);
6566
pal::check(&path, &mut bad);
6667
unstable_book::check(&path, &mut bad);
6768
if !args.iter().any(|s| *s == "--no-vendor") {

0 commit comments

Comments
 (0)