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
20 changes: 10 additions & 10 deletions schemas/codspeed.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
"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": {
"benchmarks": {
"description": "List of benchmark targets to execute",
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/Target"
}
},
"options": {
"description": "Default options to apply to all benchmark runs",
"anyOf": [
Expand All @@ -14,16 +24,6 @@
"type": "null"
}
]
},
"targets": {
"description": "List of benchmark targets to execute",
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/Target"
}
}
},
"definitions": {
Expand Down
2 changes: 1 addition & 1 deletion src/project_config/interfaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub struct ProjectConfig {
/// Default options to apply to all benchmark runs
pub options: Option<ProjectOptions>,
/// List of benchmark targets to execute
pub targets: Option<Vec<Target>>,
pub benchmarks: Option<Vec<Target>>,
}

/// A benchmark target to execute
Expand Down
6 changes: 3 additions & 3 deletions src/project_config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ options:
}),
working_directory: None,
}),
targets: None,
benchmarks: None,
};

let result = config.validate();
Expand All @@ -260,7 +260,7 @@ options:
}),
working_directory: None,
}),
targets: None,
benchmarks: None,
};

let result = config.validate();
Expand All @@ -286,7 +286,7 @@ options:
}),
working_directory: Some("./bench".to_string()),
}),
targets: None,
benchmarks: None,
};

assert!(config.validate().is_ok());
Expand Down
2 changes: 1 addition & 1 deletion src/run/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ pub async fn run(
let run_target = if args.command.is_empty() {
// No command provided - check for targets in project config
let targets = project_config
.and_then(|c| c.targets.as_ref())
.and_then(|c| c.benchmarks.as_ref())
.filter(|t| !t.is_empty())
.ok_or_else(|| {
anyhow!("No command provided and no targets defined in codspeed.yaml")
Expand Down
Loading