Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/executor/memory/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down
16 changes: 8 additions & 8 deletions src/executor/wall_time/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down Expand Up @@ -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!(
Expand Down
3 changes: 2 additions & 1 deletion src/run/uploader/interfaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand All @@ -19,6 +19,7 @@ pub struct UploadMetadata {
pub run_environment: RunEnvironment,
pub run_part: Option<RunPart>,
pub commit_hash: String,
pub allow_empty: bool,
#[serde(flatten)]
pub run_environment_metadata: RunEnvironmentMetadata,
}
Expand Down
Git LFS file not shown
3 changes: 2 additions & 1 deletion src/run/uploader/upload_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down Expand Up @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions src/run_environment/local/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
1 change: 1 addition & 0 deletions src/run_environment/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
Loading