diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 81204ed2..e109df61 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,11 @@ repos: hooks: - id: fmt args: [--all, --] - - id: cargo-check - args: [--all-targets] - id: clippy args: [--all-targets, --, -D, warnings] + - repo: local + hooks: + - id: check-config-schema + name: check config schema is up to date + entry: bash -c 'cargo run --bin generate_config_schema && git diff --exit-code schemas/codspeed.schema.json' + language: system diff --git a/Cargo.lock b/Cargo.lock index 578c22ca..e98b30fe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -460,6 +460,7 @@ dependencies = [ "rstest 0.25.0", "rstest_reuse", "runner-shared", + "schemars", "semver", "serde", "serde_json", @@ -691,6 +692,12 @@ dependencies = [ "syn 2.0.111", ] +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + [[package]] name = "either" version = "1.15.0" @@ -2661,6 +2668,30 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "schemars" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.111", +] + [[package]] name = "scopeguard" version = "1.2.0" @@ -2730,6 +2761,17 @@ dependencies = [ "syn 2.0.111", ] +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + [[package]] name = "serde_json" version = "1.0.145" diff --git a/Cargo.toml b/Cargo.toml index 3c8453fa..d1a4afd7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,7 @@ version = "4.9.0" edition = "2024" repository = "https://github.com/CodSpeedHQ/codspeed" publish = false +default-run = "codspeed" [[bin]] name = "codspeed" @@ -37,6 +38,7 @@ tokio-util = "0.7.16" md5 = "0.7.0" base64 = "0.21.0" async-compression = { version = "0.4.5", features = ["tokio", "gzip"] } +schemars = "0.8" simplelog = { version = "0.12.1", default-features = false, features = [ "termcolor", ] } @@ -119,3 +121,5 @@ strip = true [package.metadata.dist] targets = ["aarch64-unknown-linux-musl", "x86_64-unknown-linux-musl"] +binaries.aarch64-unknown-linux-musl = ["codspeed"] +binaries.x86_64-unknown-linux-musl = ["codspeed"] diff --git a/schemas/codspeed.schema.json b/schemas/codspeed.schema.json new file mode 100644 index 00000000..181180bf --- /dev/null +++ b/schemas/codspeed.schema.json @@ -0,0 +1,159 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ProjectConfig", + "description": "Project-level configuration from codspeed.yaml file\n\nThis configuration provides default options for the run and exec commands. CLI arguments always take precedence over config file values.", + "type": "object", + "properties": { + "options": { + "description": "Default options to apply to all benchmark runs", + "anyOf": [ + { + "$ref": "#/definitions/ProjectOptions" + }, + { + "type": "null" + } + ] + }, + "targets": { + "description": "List of benchmark targets to execute", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/Target" + } + } + }, + "definitions": { + "ProjectOptions": { + "description": "Root-level options that apply to all benchmark runs unless overridden by CLI", + "type": "object", + "properties": { + "max-rounds": { + "description": "Maximum number of rounds", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "max-time": { + "description": "Maximum total execution time", + "type": [ + "string", + "null" + ] + }, + "min-rounds": { + "description": "Minimum number of rounds", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "min-time": { + "description": "Minimum total execution time", + "type": [ + "string", + "null" + ] + }, + "warmup-time": { + "description": "Duration of warmup phase (e.g., \"1s\", \"500ms\")", + "type": [ + "string", + "null" + ] + }, + "working-directory": { + "description": "Working directory where commands will be executed (relative to config file)", + "type": [ + "string", + "null" + ] + } + } + }, + "Target": { + "description": "A benchmark target to execute", + "type": "object", + "required": [ + "exec" + ], + "properties": { + "exec": { + "description": "Command to execute", + "type": "string" + }, + "name": { + "description": "Optional name for this target", + "type": [ + "string", + "null" + ] + }, + "options": { + "description": "Target-specific options", + "anyOf": [ + { + "$ref": "#/definitions/TargetOptions" + }, + { + "type": "null" + } + ] + } + } + }, + "TargetOptions": { + "description": "Walltime execution options matching WalltimeExecutionArgs structure", + "type": "object", + "properties": { + "max-rounds": { + "description": "Maximum number of rounds", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "max-time": { + "description": "Maximum total execution time", + "type": [ + "string", + "null" + ] + }, + "min-rounds": { + "description": "Minimum number of rounds", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "min-time": { + "description": "Minimum total execution time", + "type": [ + "string", + "null" + ] + }, + "warmup-time": { + "description": "Duration of warmup phase (e.g., \"1s\", \"500ms\")", + "type": [ + "string", + "null" + ] + } + } + } + } +} diff --git a/src/bin/generate_config_schema.rs b/src/bin/generate_config_schema.rs new file mode 100644 index 00000000..72996a08 --- /dev/null +++ b/src/bin/generate_config_schema.rs @@ -0,0 +1,23 @@ +//! Generates JSON Schema for codspeed.yaml configuration file +//! +//! Run with: +//! ``` +//! cargo run --bin generate-config-schema +//! ``` + +use std::fs; + +use codspeed_runner::ProjectConfig; +use schemars::schema_for; + +const OUTPUT_FILE: &str = "schemas/codspeed.schema.json"; + +fn main() { + let schema = schema_for!(ProjectConfig); + let schema_json = serde_json::to_string_pretty(&schema).expect("Failed to serialize schema"); + let output_file_path = std::path::Path::new(OUTPUT_FILE); + fs::create_dir_all(output_file_path.parent().unwrap()) + .expect("Failed to create schemas directory"); + fs::write(OUTPUT_FILE, format!("{schema_json}\n")).expect("Failed to write schema file"); + println!("Schema written to {OUTPUT_FILE}"); +} diff --git a/src/executor/valgrind/helpers/venv_compat.rs b/src/executor/valgrind/helpers/venv_compat.rs index c0f9ba8d..d1d6b660 100644 --- a/src/executor/valgrind/helpers/venv_compat.rs +++ b/src/executor/valgrind/helpers/venv_compat.rs @@ -3,7 +3,7 @@ //! since they use absolute paths in the `python3` executable. //! //! However, uv uses relative paths which causes the lookups to fail: -//! ```no_run +//! ```text //! > ldd .venv/bin/python3 //! /home/project/.venv/bin/../lib/libpython3.13.so.1.0 => not found //! ``` diff --git a/src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__debug_info__tests__cpp_debug_info.snap b/src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__debug_info__tests__cpp_debug_info.snap similarity index 100% rename from src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__debug_info__tests__cpp_debug_info.snap rename to src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__debug_info__tests__cpp_debug_info.snap diff --git a/src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__debug_info__tests__golang_debug_info.snap b/src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__debug_info__tests__golang_debug_info.snap similarity index 100% rename from src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__debug_info__tests__golang_debug_info.snap rename to src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__debug_info__tests__golang_debug_info.snap diff --git a/src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__debug_info__tests__ruff_debug_info.snap b/src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__debug_info__tests__ruff_debug_info.snap similarity index 100% rename from src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__debug_info__tests__ruff_debug_info.snap rename to src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__debug_info__tests__ruff_debug_info.snap diff --git a/src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__debug_info__tests__rust_divan_debug_info.snap b/src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__debug_info__tests__rust_divan_debug_info.snap similarity index 100% rename from src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__debug_info__tests__rust_divan_debug_info.snap rename to src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__debug_info__tests__rust_divan_debug_info.snap diff --git a/src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__debug_info__tests__the_algorithms_debug_info.snap b/src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__debug_info__tests__the_algorithms_debug_info.snap similarity index 100% rename from src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__debug_info__tests__the_algorithms_debug_info.snap rename to src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__debug_info__tests__the_algorithms_debug_info.snap diff --git a/src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__perf_map__tests__cpp_symbols.snap b/src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__perf_map__tests__cpp_symbols.snap similarity index 100% rename from src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__perf_map__tests__cpp_symbols.snap rename to src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__perf_map__tests__cpp_symbols.snap diff --git a/src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__perf_map__tests__golang_symbols.snap b/src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__perf_map__tests__golang_symbols.snap similarity index 100% rename from src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__perf_map__tests__golang_symbols.snap rename to src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__perf_map__tests__golang_symbols.snap diff --git a/src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__perf_map__tests__ruff_symbols.snap b/src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__perf_map__tests__ruff_symbols.snap similarity index 100% rename from src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__perf_map__tests__ruff_symbols.snap rename to src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__perf_map__tests__ruff_symbols.snap diff --git a/src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__perf_map__tests__rust_divan_symbols.snap b/src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__perf_map__tests__rust_divan_symbols.snap similarity index 100% rename from src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__perf_map__tests__rust_divan_symbols.snap rename to src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__perf_map__tests__rust_divan_symbols.snap diff --git a/src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__perf_map__tests__the_algorithms_symbols.snap b/src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__perf_map__tests__the_algorithms_symbols.snap similarity index 100% rename from src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__perf_map__tests__the_algorithms_symbols.snap rename to src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__perf_map__tests__the_algorithms_symbols.snap diff --git a/src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__unwind_data__tests__cpp_unwind_data.snap b/src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__unwind_data__tests__cpp_unwind_data.snap similarity index 100% rename from src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__unwind_data__tests__cpp_unwind_data.snap rename to src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__unwind_data__tests__cpp_unwind_data.snap diff --git a/src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__unwind_data__tests__golang_unwind_data.snap b/src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__unwind_data__tests__golang_unwind_data.snap similarity index 100% rename from src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__unwind_data__tests__golang_unwind_data.snap rename to src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__unwind_data__tests__golang_unwind_data.snap diff --git a/src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__unwind_data__tests__ruff_unwind_data.snap b/src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__unwind_data__tests__ruff_unwind_data.snap similarity index 100% rename from src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__unwind_data__tests__ruff_unwind_data.snap rename to src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__unwind_data__tests__ruff_unwind_data.snap diff --git a/src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__unwind_data__tests__rust_divan_unwind_data.snap b/src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__unwind_data__tests__rust_divan_unwind_data.snap similarity index 100% rename from src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__unwind_data__tests__rust_divan_unwind_data.snap rename to src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__unwind_data__tests__rust_divan_unwind_data.snap diff --git a/src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__unwind_data__tests__the_algorithms_unwind_data.snap b/src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__unwind_data__tests__the_algorithms_unwind_data.snap similarity index 100% rename from src/executor/wall_time/perf/snapshots/codspeed__executor__wall_time__perf__unwind_data__tests__the_algorithms_unwind_data.snap rename to src/executor/wall_time/perf/snapshots/codspeed_runner__executor__wall_time__perf__unwind_data__tests__the_algorithms_unwind_data.snap diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 00000000..af122e4f --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,38 @@ +//! CodSpeed Runner library + +mod api_client; +pub mod app; +mod auth; +mod binary_installer; +mod config; +mod exec; +mod executor; +mod instruments; +mod local_logger; +pub mod logger; +mod prelude; +mod project_config; +mod request_client; +mod run; +mod run_environment; +mod runner_mode; +mod setup; + +pub use local_logger::clean_logger; +pub use project_config::{ProjectConfig, ProjectOptions, Target, TargetOptions, WalltimeOptions}; +pub use runner_mode::RunnerMode; + +use lazy_static::lazy_static; +use semver::Version; + +pub const VERSION: &str = env!("CARGO_PKG_VERSION"); +pub const MONGODB_TRACER_VERSION: &str = "cs-mongo-tracer-v0.2.0"; + +pub const VALGRIND_CODSPEED_VERSION: Version = Version::new(3, 26, 0); +pub const VALGRIND_CODSPEED_DEB_REVISION_SUFFIX: &str = "0codspeed0"; +lazy_static! { + pub static ref VALGRIND_CODSPEED_VERSION_STRING: String = + format!("{VALGRIND_CODSPEED_VERSION}.codspeed"); + pub static ref VALGRIND_CODSPEED_DEB_VERSION: String = + format!("{VALGRIND_CODSPEED_VERSION}-{VALGRIND_CODSPEED_DEB_REVISION_SUFFIX}"); +} diff --git a/src/logger.rs b/src/logger.rs index cf0663c6..081b265d 100644 --- a/src/logger.rs +++ b/src/logger.rs @@ -9,6 +9,8 @@ pub const ANNOUNCEMENT_TARGET: &str = "codspeed::announcement"; /// # Example /// /// ```rust +/// # use codspeed_runner::{start_group, end_group}; +/// # use log::info; /// start_group!("My group"); /// info!("This will be grouped"); /// end_group!(); @@ -25,6 +27,8 @@ macro_rules! start_group { /// # Example /// /// ```rust +/// # use codspeed_runner::{start_opened_group, end_group}; +/// # use log::info; /// start_opened_group!("My group"); /// info!("This will be grouped"); /// end_group!(); diff --git a/src/main.rs b/src/main.rs index 8ff00e69..ace11d2e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,55 +1,21 @@ -mod api_client; -mod app; -mod auth; -mod binary_installer; -mod config; -mod exec; -mod executor; -mod instruments; -mod local_logger; -mod logger; -mod prelude; -mod project_config; -mod request_client; -mod run; -mod run_environment; -mod runner_mode; -mod setup; - +use codspeed_runner::{app, clean_logger}; use console::style; -use lazy_static::lazy_static; -use local_logger::clean_logger; -use prelude::*; -use semver::Version; - use log::log_enabled; -pub const VERSION: &str = env!("CARGO_PKG_VERSION"); -pub const MONGODB_TRACER_VERSION: &str = "cs-mongo-tracer-v0.2.0"; - -pub const VALGRIND_CODSPEED_VERSION: Version = Version::new(3, 26, 0); -pub const VALGRIND_CODSPEED_DEB_REVISION_SUFFIX: &str = "0codspeed0"; -lazy_static! { - pub static ref VALGRIND_CODSPEED_VERSION_STRING: String = - format!("{VALGRIND_CODSPEED_VERSION}.codspeed"); - pub static ref VALGRIND_CODSPEED_DEB_VERSION: String = - format!("{VALGRIND_CODSPEED_VERSION}-{VALGRIND_CODSPEED_DEB_REVISION_SUFFIX}"); -} - #[tokio::main(flavor = "current_thread")] async fn main() { - let res = crate::app::run().await; + let res = app::run().await; if let Err(err) = res { for cause in err.chain() { if log_enabled!(log::Level::Error) { - error!("{} {}", style("Error:").bold().red(), style(cause).red()); + log::error!("{} {}", style("Error:").bold().red(), style(cause).red()); } else { eprintln!("Error: {cause}"); } } if log_enabled!(log::Level::Debug) { for e in err.chain().skip(1) { - debug!("Caused by: {e}"); + log::debug!("Caused by: {e}"); } } clean_logger(); diff --git a/src/project_config/interfaces.rs b/src/project_config/interfaces.rs index 6271a256..4418dcf6 100644 --- a/src/project_config/interfaces.rs +++ b/src/project_config/interfaces.rs @@ -1,11 +1,11 @@ -use crate::runner_mode::RunnerMode; +use schemars::JsonSchema; use serde::{Deserialize, Serialize}; /// Project-level configuration from codspeed.yaml file /// /// This configuration provides default options for the run and exec commands. /// CLI arguments always take precedence over config file values. -#[derive(Debug, Deserialize, Serialize, PartialEq)] +#[derive(Debug, Deserialize, Serialize, PartialEq, JsonSchema)] #[serde(rename_all = "kebab-case")] pub struct ProjectConfig { /// Default options to apply to all benchmark runs @@ -15,7 +15,7 @@ pub struct ProjectConfig { } /// A benchmark target to execute -#[derive(Debug, Deserialize, Serialize, PartialEq)] +#[derive(Debug, Deserialize, Serialize, PartialEq, JsonSchema)] #[serde(rename_all = "kebab-case")] pub struct Target { /// Optional name for this target @@ -26,7 +26,7 @@ pub struct Target { pub options: Option, } -#[derive(Debug, Deserialize, Serialize, PartialEq)] +#[derive(Debug, Deserialize, Serialize, PartialEq, JsonSchema)] #[serde(rename_all = "kebab-case")] pub struct TargetOptions { #[serde(flatten)] @@ -34,20 +34,18 @@ pub struct TargetOptions { } /// Root-level options that apply to all benchmark runs unless overridden by CLI -#[derive(Debug, Deserialize, Serialize, PartialEq)] +#[derive(Debug, Deserialize, Serialize, PartialEq, JsonSchema)] #[serde(rename_all = "kebab-case")] pub struct ProjectOptions { /// Working directory where commands will be executed (relative to config file) pub working_directory: Option, - /// Runner mode (walltime, memory, or simulation) - pub mode: Option, /// Walltime execution configuration (flattened) #[serde(flatten)] pub walltime: Option, } /// Walltime execution options matching WalltimeExecutionArgs structure -#[derive(Debug, Deserialize, Serialize, PartialEq)] +#[derive(Debug, Deserialize, Serialize, PartialEq, JsonSchema)] #[serde(rename_all = "kebab-case")] pub struct WalltimeOptions { /// Duration of warmup phase (e.g., "1s", "500ms") diff --git a/src/project_config/merger.rs b/src/project_config/merger.rs index d7b730aa..3f19bec2 100644 --- a/src/project_config/merger.rs +++ b/src/project_config/merger.rs @@ -173,7 +173,6 @@ mod tests { let config = ProjectOptions { walltime: None, working_directory: Some("./config-dir".to_string()), - mode: Some(RunnerMode::Simulation), }; let merged = ConfigMerger::merge_shared_args(&cli, Some(&config)); @@ -206,7 +205,6 @@ mod tests { let config = ProjectOptions { walltime: None, working_directory: Some("./config-dir".to_string()), - mode: Some(RunnerMode::Memory), }; let merged = ConfigMerger::merge_shared_args(&cli, Some(&config)); diff --git a/src/project_config/mod.rs b/src/project_config/mod.rs index d5ccc6d6..0cf6338a 100644 --- a/src/project_config/mod.rs +++ b/src/project_config/mod.rs @@ -173,7 +173,6 @@ impl ProjectConfig { #[cfg(test)] mod tests { use super::*; - use crate::runner_mode::RunnerMode; use tempfile::TempDir; #[test] @@ -202,7 +201,6 @@ options: max-rounds: 100 min-rounds: 10 working-directory: ./bench - mode: walltime "#; let config: ProjectConfig = serde_yaml::from_str(yaml).unwrap(); let options = config.options.unwrap(); @@ -214,7 +212,6 @@ options: assert_eq!(walltime.max_rounds, Some(100)); assert_eq!(walltime.min_rounds, Some(10)); assert_eq!(options.working_directory, Some("./bench".to_string())); - assert_eq!(options.mode, Some(RunnerMode::Walltime)); } #[test] @@ -236,7 +233,6 @@ options: min_rounds: None, }), working_directory: None, - mode: None, }), targets: None, }; @@ -263,7 +259,6 @@ options: min_rounds: Some(5), }), working_directory: None, - mode: None, }), targets: None, }; @@ -290,7 +285,6 @@ options: min_rounds: None, }), working_directory: Some("./bench".to_string()), - mode: Some(RunnerMode::Walltime), }), targets: None, }; diff --git a/src/run/uploader/snapshots/codspeed__run__uploader__upload_metadata__tests__get_metadata_hash-2.snap b/src/run/uploader/snapshots/codspeed_runner__run__uploader__upload_metadata__tests__get_metadata_hash-2.snap similarity index 100% rename from src/run/uploader/snapshots/codspeed__run__uploader__upload_metadata__tests__get_metadata_hash-2.snap rename to src/run/uploader/snapshots/codspeed_runner__run__uploader__upload_metadata__tests__get_metadata_hash-2.snap diff --git a/src/run_environment/buildkite/snapshots/codspeed__run_environment__buildkite__provider__tests__pull_request_run_environment_metadata.snap b/src/run_environment/buildkite/snapshots/codspeed_runner__run_environment__buildkite__provider__tests__pull_request_run_environment_metadata.snap similarity index 100% rename from src/run_environment/buildkite/snapshots/codspeed__run_environment__buildkite__provider__tests__pull_request_run_environment_metadata.snap rename to src/run_environment/buildkite/snapshots/codspeed_runner__run_environment__buildkite__provider__tests__pull_request_run_environment_metadata.snap diff --git a/src/run_environment/github_actions/snapshots/codspeed__run_environment__github_actions__provider__tests__fork_pull_request_run_environment_metadata-2.snap b/src/run_environment/github_actions/snapshots/codspeed_runner__run_environment__github_actions__provider__tests__fork_pull_request_run_environment_metadata-2.snap similarity index 100% rename from src/run_environment/github_actions/snapshots/codspeed__run_environment__github_actions__provider__tests__fork_pull_request_run_environment_metadata-2.snap rename to src/run_environment/github_actions/snapshots/codspeed_runner__run_environment__github_actions__provider__tests__fork_pull_request_run_environment_metadata-2.snap diff --git a/src/run_environment/github_actions/snapshots/codspeed__run_environment__github_actions__provider__tests__fork_pull_request_run_environment_metadata.snap b/src/run_environment/github_actions/snapshots/codspeed_runner__run_environment__github_actions__provider__tests__fork_pull_request_run_environment_metadata.snap similarity index 100% rename from src/run_environment/github_actions/snapshots/codspeed__run_environment__github_actions__provider__tests__fork_pull_request_run_environment_metadata.snap rename to src/run_environment/github_actions/snapshots/codspeed_runner__run_environment__github_actions__provider__tests__fork_pull_request_run_environment_metadata.snap diff --git a/src/run_environment/github_actions/snapshots/codspeed__run_environment__github_actions__provider__tests__matrix_job_run_environment_metadata-2.snap b/src/run_environment/github_actions/snapshots/codspeed_runner__run_environment__github_actions__provider__tests__matrix_job_run_environment_metadata-2.snap similarity index 100% rename from src/run_environment/github_actions/snapshots/codspeed__run_environment__github_actions__provider__tests__matrix_job_run_environment_metadata-2.snap rename to src/run_environment/github_actions/snapshots/codspeed_runner__run_environment__github_actions__provider__tests__matrix_job_run_environment_metadata-2.snap diff --git a/src/run_environment/github_actions/snapshots/codspeed__run_environment__github_actions__provider__tests__matrix_job_run_environment_metadata.snap b/src/run_environment/github_actions/snapshots/codspeed_runner__run_environment__github_actions__provider__tests__matrix_job_run_environment_metadata.snap similarity index 100% rename from src/run_environment/github_actions/snapshots/codspeed__run_environment__github_actions__provider__tests__matrix_job_run_environment_metadata.snap rename to src/run_environment/github_actions/snapshots/codspeed_runner__run_environment__github_actions__provider__tests__matrix_job_run_environment_metadata.snap diff --git a/src/run_environment/github_actions/snapshots/codspeed__run_environment__github_actions__provider__tests__pull_request_run_environment_metadata-2.snap b/src/run_environment/github_actions/snapshots/codspeed_runner__run_environment__github_actions__provider__tests__pull_request_run_environment_metadata-2.snap similarity index 100% rename from src/run_environment/github_actions/snapshots/codspeed__run_environment__github_actions__provider__tests__pull_request_run_environment_metadata-2.snap rename to src/run_environment/github_actions/snapshots/codspeed_runner__run_environment__github_actions__provider__tests__pull_request_run_environment_metadata-2.snap diff --git a/src/run_environment/github_actions/snapshots/codspeed__run_environment__github_actions__provider__tests__pull_request_run_environment_metadata.snap b/src/run_environment/github_actions/snapshots/codspeed_runner__run_environment__github_actions__provider__tests__pull_request_run_environment_metadata.snap similarity index 100% rename from src/run_environment/github_actions/snapshots/codspeed__run_environment__github_actions__provider__tests__pull_request_run_environment_metadata.snap rename to src/run_environment/github_actions/snapshots/codspeed_runner__run_environment__github_actions__provider__tests__pull_request_run_environment_metadata.snap diff --git a/src/run_environment/gitlab_ci/snapshots/codspeed__run_environment__gitlab_ci__provider__tests__fork_merge_request_run_environment_metadata-2.snap b/src/run_environment/gitlab_ci/snapshots/codspeed_runner__run_environment__gitlab_ci__provider__tests__fork_merge_request_run_environment_metadata-2.snap similarity index 100% rename from src/run_environment/gitlab_ci/snapshots/codspeed__run_environment__gitlab_ci__provider__tests__fork_merge_request_run_environment_metadata-2.snap rename to src/run_environment/gitlab_ci/snapshots/codspeed_runner__run_environment__gitlab_ci__provider__tests__fork_merge_request_run_environment_metadata-2.snap diff --git a/src/run_environment/gitlab_ci/snapshots/codspeed__run_environment__gitlab_ci__provider__tests__fork_merge_request_run_environment_metadata.snap b/src/run_environment/gitlab_ci/snapshots/codspeed_runner__run_environment__gitlab_ci__provider__tests__fork_merge_request_run_environment_metadata.snap similarity index 100% rename from src/run_environment/gitlab_ci/snapshots/codspeed__run_environment__gitlab_ci__provider__tests__fork_merge_request_run_environment_metadata.snap rename to src/run_environment/gitlab_ci/snapshots/codspeed_runner__run_environment__gitlab_ci__provider__tests__fork_merge_request_run_environment_metadata.snap diff --git a/src/run_environment/gitlab_ci/snapshots/codspeed__run_environment__gitlab_ci__provider__tests__merge_request_run_environment_metadata-2.snap b/src/run_environment/gitlab_ci/snapshots/codspeed_runner__run_environment__gitlab_ci__provider__tests__merge_request_run_environment_metadata-2.snap similarity index 100% rename from src/run_environment/gitlab_ci/snapshots/codspeed__run_environment__gitlab_ci__provider__tests__merge_request_run_environment_metadata-2.snap rename to src/run_environment/gitlab_ci/snapshots/codspeed_runner__run_environment__gitlab_ci__provider__tests__merge_request_run_environment_metadata-2.snap diff --git a/src/run_environment/gitlab_ci/snapshots/codspeed__run_environment__gitlab_ci__provider__tests__merge_request_run_environment_metadata.snap b/src/run_environment/gitlab_ci/snapshots/codspeed_runner__run_environment__gitlab_ci__provider__tests__merge_request_run_environment_metadata.snap similarity index 100% rename from src/run_environment/gitlab_ci/snapshots/codspeed__run_environment__gitlab_ci__provider__tests__merge_request_run_environment_metadata.snap rename to src/run_environment/gitlab_ci/snapshots/codspeed_runner__run_environment__gitlab_ci__provider__tests__merge_request_run_environment_metadata.snap diff --git a/src/run_environment/gitlab_ci/snapshots/codspeed__run_environment__gitlab_ci__provider__tests__push_main_run_environment_metadata-2.snap b/src/run_environment/gitlab_ci/snapshots/codspeed_runner__run_environment__gitlab_ci__provider__tests__push_main_run_environment_metadata-2.snap similarity index 100% rename from src/run_environment/gitlab_ci/snapshots/codspeed__run_environment__gitlab_ci__provider__tests__push_main_run_environment_metadata-2.snap rename to src/run_environment/gitlab_ci/snapshots/codspeed_runner__run_environment__gitlab_ci__provider__tests__push_main_run_environment_metadata-2.snap diff --git a/src/run_environment/gitlab_ci/snapshots/codspeed__run_environment__gitlab_ci__provider__tests__push_main_run_environment_metadata.snap b/src/run_environment/gitlab_ci/snapshots/codspeed_runner__run_environment__gitlab_ci__provider__tests__push_main_run_environment_metadata.snap similarity index 100% rename from src/run_environment/gitlab_ci/snapshots/codspeed__run_environment__gitlab_ci__provider__tests__push_main_run_environment_metadata.snap rename to src/run_environment/gitlab_ci/snapshots/codspeed_runner__run_environment__gitlab_ci__provider__tests__push_main_run_environment_metadata.snap diff --git a/src/run_environment/provider.rs b/src/run_environment/provider.rs index 6c84216c..46e84d0c 100644 --- a/src/run_environment/provider.rs +++ b/src/run_environment/provider.rs @@ -79,7 +79,7 @@ pub trait RunEnvironmentProvider { /// /// # Example /// - /// ``` + /// ```rust,ignore /// let provider = MyCIProvider::new(); /// let config = Config::new(); /// let instruments = Instruments::new();