From fd7339964d9b993946f2812f63f84522c31922d2 Mon Sep 17 00:00:00 2001 From: Guillaume Lagrange Date: Thu, 12 Mar 2026 17:55:47 +0100 Subject: [PATCH] fix: improve error message when no benchmarks are found Handle the `NoBenchmarks` variant in `ReportConclusion` and display a warning when results are empty instead of silently showing nothing. --- src/api_client.rs | 4 ++++ src/upload/poll_results.rs | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/api_client.rs b/src/api_client.rs index 03b9e469..69b1d892 100644 --- a/src/api_client.rs +++ b/src/api_client.rs @@ -92,6 +92,7 @@ pub enum ReportConclusion { AcknowledgedFailure, Failure, MissingBaseRun, + NoBenchmarks, Success, } @@ -105,6 +106,9 @@ impl Display for ReportConclusion { ReportConclusion::MissingBaseRun => { write!(f, "{}", style("Missing Base Run").yellow().bold()) } + ReportConclusion::NoBenchmarks => { + write!(f, "{}", style("No Benchmarks").yellow().bold()) + } ReportConclusion::Success => write!(f, "{}", style("Success").green().bold()), } } diff --git a/src/upload/poll_results.rs b/src/upload/poll_results.rs index e1ed7d39..c984f9cc 100644 --- a/src/upload/poll_results.rs +++ b/src/upload/poll_results.rs @@ -72,7 +72,11 @@ pub async fn poll_results( )); } - if !response.run.results.is_empty() { + if response.run.results.is_empty() { + warn!( + "No benchmarks were found in the run. Make sure your command runs benchmarks that are instrumented with a CodSpeed integration." + ); + } else { end_group!(); start_group!("Benchmark results");