diff --git a/lib/bencher_comment/src/lib.rs b/lib/bencher_comment/src/lib.rs index a45692923..10cf525d7 100644 --- a/lib/bencher_comment/src/lib.rs +++ b/lib/bencher_comment/src/lib.rs @@ -185,7 +185,7 @@ impl ReportComment { fn html_benchmarks(&self, html: &mut String, require_threshold: bool) { self.html_no_benchmarks(html); - self.html_no_threshold(html); + self.html_no_threshold(html, require_threshold); self.html_alerts(html); self.html_benchmark_details(html, require_threshold); } @@ -196,8 +196,8 @@ impl ReportComment { } } - fn html_no_threshold(&self, html: &mut String) { - if self.benchmark_count == 0 || self.missing_threshold.is_empty() { + fn html_no_threshold(&self, html: &mut String, require_threshold: bool) { + if self.benchmark_count == 0 || self.missing_threshold.is_empty() || require_threshold { return; } @@ -214,7 +214,7 @@ impl ReportComment { html.push_str(&format!("

Click here to create a new Threshold
", console_url = self.console_url, project = self.project_slug, utm = self.utm_query())); html.push_str(&format!("For more information, see the Threshold documentation.
", utm = self.utm_query())); - html.push_str(&format!("To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

", utm = self.utm_query())); + html.push_str(&format!("To only post results if a Threshold exists, set the --ci-only-thresholds flag.

", utm = self.utm_query())); html.push_str(""); }