Skip to content

Commit 5e904f7

Browse files
Move new errors message to summary
1 parent 0dd5562 commit 5e904f7

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

site/src/comparison.rs

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ pub struct ComparisonSummary {
174174
num_improvements: usize,
175175
/// The cached number of comparisons that are regressions
176176
num_regressions: usize,
177+
/// Which benchmarks had errors
178+
errors_in: Vec<String>,
177179
}
178180

179181
impl ComparisonSummary {
@@ -208,10 +210,17 @@ impl ComparisonSummary {
208210
};
209211
comparisons.sort_by(cmp);
210212

213+
let errors_in = comparison
214+
.new_errors
215+
.keys()
216+
.map(|k| k.as_str().to_owned())
217+
.collect::<Vec<_>>();
218+
211219
Some(ComparisonSummary {
212220
comparisons,
213221
num_improvements,
214222
num_regressions,
223+
errors_in,
215224
})
216225
}
217226

@@ -351,8 +360,6 @@ impl ComparisonSummary {
351360
}
352361

353362
async fn write(&self, comparison: &Comparison) -> String {
354-
use std::fmt::Write;
355-
356363
let mut result = if let Some(pr) = comparison.b.pr {
357364
let title = github::pr_title(pr).await;
358365
format!(
@@ -368,20 +375,6 @@ impl ComparisonSummary {
368375

369376
self.write_summary_lines(&mut result, Some(link));
370377

371-
if !comparison.new_errors.is_empty() {
372-
write!(
373-
result,
374-
"- New errors in {}",
375-
comparison
376-
.new_errors
377-
.keys()
378-
.map(|k| k.as_str())
379-
.collect::<Vec<_>>()
380-
.join(", ")
381-
)
382-
.unwrap();
383-
}
384-
385378
result
386379
}
387380

@@ -407,6 +400,15 @@ impl ComparisonSummary {
407400
write!(result, "- ").unwrap();
408401
change.summary_line(result, link)
409402
}
403+
404+
if !self.errors_in.is_empty() {
405+
write!(
406+
result,
407+
"- Benchmark(s) {} started failing to build",
408+
self.errors_in.join(", ")
409+
)
410+
.unwrap();
411+
}
410412
}
411413
}
412414

0 commit comments

Comments
 (0)