Skip to content

Commit f4e7752

Browse files
authored
Merge pull request #1935 from Kobzol/broken-benchmark-alert
Add more visible warning when a benchmark fails to compile in a PR
2 parents b29542a + 32bc42a commit f4e7752

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

site/src/github/comparison_summary.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,18 @@ async fn summarize_run(
176176
let inst_comparison =
177177
calculate_metric_comparison(ctxt, &commit, Metric::InstructionsUser).await?;
178178

179-
let errors = if !inst_comparison.newly_failed_benchmarks.is_empty() {
179+
let has_broken_benchmarks = !inst_comparison.newly_failed_benchmarks.is_empty();
180+
let errors = if has_broken_benchmarks {
180181
let benchmarks = inst_comparison
181182
.newly_failed_benchmarks
182183
.keys()
183184
.map(|benchmark| format!("- {benchmark}"))
184185
.collect::<Vec<_>>()
185186
.join("\n");
186-
format!("\n**Warning ⚠**: The following benchmark(s) failed to build:\n{benchmarks}\n")
187+
let alert_row = ":exclamation: ".repeat(5);
188+
format!(
189+
"\n{alert_row}\n**Warning :warning:**: The following benchmark(s) failed to build:\n{benchmarks}\n{alert_row}\n"
190+
)
187191
} else {
188192
String::new()
189193
};
@@ -206,7 +210,9 @@ async fn summarize_run(
206210
&mut message,
207211
"### Overall result: {}{}\n",
208212
overall_result,
209-
if is_regression {
213+
if has_broken_benchmarks {
214+
" - BENCHMARK(S) FAILED"
215+
} else if is_regression {
210216
" - ACTION NEEDED"
211217
} else {
212218
" - no action needed"

0 commit comments

Comments
 (0)