From 226f170686eb2f534999288b5be41cb9f038f4a1 Mon Sep 17 00:00:00 2001 From: fargito Date: Thu, 22 Jan 2026 15:14:31 +0100 Subject: [PATCH 1/2] feat(executors): no longer warn on missing results --- src/executor/memory/executor.rs | 13 ++++++++++--- src/executor/wall_time/helpers.rs | 16 ++++++++-------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/executor/memory/executor.rs b/src/executor/memory/executor.rs index f3018b18..6f790ad8 100644 --- a/src/executor/memory/executor.rs +++ b/src/executor/memory/executor.rs @@ -131,10 +131,17 @@ impl Executor for MemoryExecutor { .flat_map(|f| std::fs::File::open(f.path())) .filter(|file| !MemtrackArtifact::is_empty(file)) .collect(); + if files.is_empty() { - bail!( - "No memtrack artifact files found. Does the integration support memory profiling?" - ); + if !execution_context.config.allow_empty { + bail!( + "No memtrack artifact files found. Does the integration support memory profiling?" + ); + } else { + info!( + "No memtrack artifact files found. Does the integration support memory profiling?" + ); + } } Ok(()) diff --git a/src/executor/wall_time/helpers.rs b/src/executor/wall_time/helpers.rs index 23c15acc..39f03de6 100644 --- a/src/executor/wall_time/helpers.rs +++ b/src/executor/wall_time/helpers.rs @@ -17,7 +17,7 @@ pub fn validate_walltime_results(profile_folder: &Path, allow_empty: bool) -> Re if !results_dir.exists() { if allow_empty { - warn!("No walltime results found in profile folder: {results_dir:?}."); + info!("No walltime results found in profile folder: {results_dir:?}."); return Ok(()); } bail!(add_empty_result_error_explanation(&format!( @@ -52,18 +52,18 @@ pub fn validate_walltime_results(profile_folder: &Path, allow_empty: bool) -> Re ))); } debug!("No benchmarks found in {path:?} (allowed)"); + } else { + found_benchmark_results = true; + debug!( + "Found {} benchmark(s) in {path:?}", + results.benchmarks.len() + ); } - - found_benchmark_results = true; - debug!( - "Found {} benchmark(s) in {path:?}", - results.benchmarks.len() - ); } if !found_benchmark_results { if allow_empty { - warn!("No JSON result files found in: {results_dir:?}."); + info!("No JSON result files found in: {results_dir:?}."); return Ok(()); } bail!(add_empty_result_error_explanation(&format!( From 33344f8df3cf1dc772d57cc92c1bb380b8524120 Mon Sep 17 00:00:00 2001 From: fargito Date: Thu, 22 Jan 2026 15:30:17 +0100 Subject: [PATCH 2/2] feat(upload): add `allow_empty` in upload metadata --- src/run/uploader/interfaces.rs | 3 ++- ...uploader__upload_metadata__tests__get_metadata_hash-2.snap | 4 ++-- src/run/uploader/upload_metadata.rs | 3 ++- src/run_environment/local/provider.rs | 1 + src/run_environment/provider.rs | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/run/uploader/interfaces.rs b/src/run/uploader/interfaces.rs index 6d885f1b..026af2f5 100644 --- a/src/run/uploader/interfaces.rs +++ b/src/run/uploader/interfaces.rs @@ -5,7 +5,7 @@ use crate::instruments::InstrumentName; use crate::run::check_system::SystemInfo; use crate::run_environment::{RepositoryProvider, RunEnvironment, RunEnvironmentMetadata, RunPart}; -pub const LATEST_UPLOAD_METADATA_VERSION: u32 = 7; +pub const LATEST_UPLOAD_METADATA_VERSION: u32 = 8; #[derive(Deserialize, Serialize, Debug)] #[serde(rename_all = "camelCase")] @@ -19,6 +19,7 @@ pub struct UploadMetadata { pub run_environment: RunEnvironment, pub run_part: Option, pub commit_hash: String, + pub allow_empty: bool, #[serde(flatten)] pub run_environment_metadata: RunEnvironmentMetadata, } diff --git a/src/run/uploader/snapshots/codspeed__run__uploader__upload_metadata__tests__get_metadata_hash-2.snap b/src/run/uploader/snapshots/codspeed__run__uploader__upload_metadata__tests__get_metadata_hash-2.snap index c98b73f1..124ed192 100644 --- a/src/run/uploader/snapshots/codspeed__run__uploader__upload_metadata__tests__get_metadata_hash-2.snap +++ b/src/run/uploader/snapshots/codspeed__run__uploader__upload_metadata__tests__get_metadata_hash-2.snap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5967ad62545b7a2816a10a2c92436d84b14b9eb7f4a55d841d1f8c4f669945c6 -size 1349 +oid sha256:45dd370f89126d39831fa65a8a507c045e0e8eaa08a986c4493807b85c13fe91 +size 1372 diff --git a/src/run/uploader/upload_metadata.rs b/src/run/uploader/upload_metadata.rs index 62ddd815..3db452e9 100644 --- a/src/run/uploader/upload_metadata.rs +++ b/src/run/uploader/upload_metadata.rs @@ -43,6 +43,7 @@ mod tests { }, run_environment: RunEnvironment::GithubActions, commit_hash: "5bd77cb0da72bef094893ed45fb793ff16ecfbe3".into(), + allow_empty: false, run_environment_metadata: RunEnvironmentMetadata { ref_: "refs/pull/29/merge".into(), head_ref: Some("chore/native-action-runner".into()), @@ -77,7 +78,7 @@ mod tests { hash, // Caution: when changing this value, we need to ensure that // the related backend snapshot remains the same - @"7275243b4457a8fa70215c084210bea7518a3994b863e4437fa33c5ae2bd219e" + @"11f363bd959389e57c79f6fc7d5c965d168c7b2f3cb2b566b647588b23322013" ); assert_json_snapshot!(upload_metadata); } diff --git a/src/run_environment/local/provider.rs b/src/run_environment/local/provider.rs index d250286c..980506d9 100644 --- a/src/run_environment/local/provider.rs +++ b/src/run_environment/local/provider.rs @@ -226,6 +226,7 @@ impl RunEnvironmentProvider for LocalProvider { tokenless: config.token.is_none(), repository_provider, commit_hash: run_environment_metadata.ref_.clone(), + allow_empty: config.allow_empty, run_environment_metadata, profile_md5: profile_archive.hash.clone(), profile_encoding: profile_archive.content.encoding(), diff --git a/src/run_environment/provider.rs b/src/run_environment/provider.rs index c9e47add..6c84216c 100644 --- a/src/run_environment/provider.rs +++ b/src/run_environment/provider.rs @@ -123,6 +123,7 @@ pub trait RunEnvironmentProvider { profile_md5: profile_archive.hash.clone(), profile_encoding: profile_archive.content.encoding(), commit_hash, + allow_empty: config.allow_empty, runner: Runner { name: "codspeed-runner".into(), version: crate::VERSION.into(),