@@ -206,7 +206,13 @@ impl PerfRunner {
206206 harvest_perf_maps_for_pids ( profile_folder, & perf_map_pids) . await ?;
207207
208208 // Append perf maps, unwind info and other metadata
209- bench_data. save_to ( profile_folder) . unwrap ( ) ;
209+ if let Err ( BenchmarkDataSaveError :: MissingIntegration ) = bench_data. save_to ( profile_folder)
210+ {
211+ warn ! (
212+ "Perf is enabled, but failed to detect benchmarks. If you wish to disable this warning, set CODSPEED_PERF_ENABLED=false"
213+ ) ;
214+ return Ok ( ( ) ) ;
215+ }
210216
211217 let elapsed = start. elapsed ( ) ;
212218 debug ! ( "Perf teardown took: {elapsed:?}" ) ;
@@ -371,8 +377,16 @@ pub struct BenchmarkData {
371377 unwind_data_by_pid : HashMap < u32 , Vec < UnwindData > > ,
372378}
373379
380+ #[ derive( Debug ) ]
381+ pub enum BenchmarkDataSaveError {
382+ MissingIntegration ,
383+ }
384+
374385impl BenchmarkData {
375- pub fn save_to < P : AsRef < std:: path:: Path > > ( & self , path : P ) -> anyhow:: Result < ( ) > {
386+ pub fn save_to < P : AsRef < std:: path:: Path > > (
387+ & self ,
388+ path : P ,
389+ ) -> Result < ( ) , BenchmarkDataSaveError > {
376390 for proc_sym in self . symbols_by_pid . values ( ) {
377391 proc_sym. save_to ( & path) . unwrap ( ) ;
378392 }
@@ -387,7 +401,7 @@ impl BenchmarkData {
387401 integration : self
388402 . integration
389403 . clone ( )
390- . context ( "Couldn't find integration metadata" ) ?,
404+ . ok_or ( BenchmarkDataSaveError :: MissingIntegration ) ?,
391405 bench_order_by_pid : self . bench_order_by_pid . clone ( ) ,
392406 ignored_modules : {
393407 let mut to_ignore = vec ! [ ] ;
0 commit comments