Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move new errors message to summary #1169

Merged
merged 1 commit into from
Feb 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions site/src/comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ pub struct ComparisonSummary {
num_improvements: usize,
/// The cached number of comparisons that are regressions
num_regressions: usize,
/// Which benchmarks had errors
errors_in: Vec<String>,
}

impl ComparisonSummary {
Expand Down Expand Up @@ -208,10 +210,17 @@ impl ComparisonSummary {
};
comparisons.sort_by(cmp);

let errors_in = comparison
.new_errors
.keys()
.map(|k| k.as_str().to_owned())
.collect::<Vec<_>>();

Some(ComparisonSummary {
comparisons,
num_improvements,
num_regressions,
errors_in,
})
}

Expand Down Expand Up @@ -351,8 +360,6 @@ impl ComparisonSummary {
}

async fn write(&self, comparison: &Comparison) -> String {
use std::fmt::Write;

let mut result = if let Some(pr) = comparison.b.pr {
let title = github::pr_title(pr).await;
format!(
Expand All @@ -368,20 +375,6 @@ impl ComparisonSummary {

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

if !comparison.new_errors.is_empty() {
write!(
result,
"- New errors in {}",
comparison
.new_errors
.keys()
.map(|k| k.as_str())
.collect::<Vec<_>>()
.join(", ")
)
.unwrap();
}

result
}

Expand All @@ -407,6 +400,15 @@ impl ComparisonSummary {
write!(result, "- ").unwrap();
change.summary_line(result, link)
}

if !self.errors_in.is_empty() {
write!(
result,
"- Benchmark(s) {} started failing to build",
self.errors_in.join(", ")
)
.unwrap();
}
}
}

Expand Down