Skip to content

Commit cd70f6c

Browse files
fix: rename targets to benchmarks in the project_config to match spec
Keeping `targets` alias to avoid breaking changes
1 parent 4f99856 commit cd70f6c

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

schemas/codspeed.schema.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
"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.",
55
"type": "object",
66
"properties": {
7+
"benchmarks": {
8+
"description": "List of benchmark targets to execute",
9+
"type": [
10+
"array",
11+
"null"
12+
],
13+
"items": {
14+
"$ref": "#/definitions/Target"
15+
}
16+
},
717
"options": {
818
"description": "Default options to apply to all benchmark runs",
919
"anyOf": [
@@ -14,16 +24,6 @@
1424
"type": "null"
1525
}
1626
]
17-
},
18-
"targets": {
19-
"description": "List of benchmark targets to execute",
20-
"type": [
21-
"array",
22-
"null"
23-
],
24-
"items": {
25-
"$ref": "#/definitions/Target"
26-
}
2727
}
2828
},
2929
"definitions": {

src/project_config/interfaces.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub struct ProjectConfig {
1111
/// Default options to apply to all benchmark runs
1212
pub options: Option<ProjectOptions>,
1313
/// List of benchmark targets to execute
14-
pub targets: Option<Vec<Target>>,
14+
pub benchmarks: Option<Vec<Target>>,
1515
}
1616

1717
/// A benchmark target to execute

src/project_config/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ options:
234234
}),
235235
working_directory: None,
236236
}),
237-
targets: None,
237+
benchmarks: None,
238238
};
239239

240240
let result = config.validate();
@@ -260,7 +260,7 @@ options:
260260
}),
261261
working_directory: None,
262262
}),
263-
targets: None,
263+
benchmarks: None,
264264
};
265265

266266
let result = config.validate();
@@ -286,7 +286,7 @@ options:
286286
}),
287287
working_directory: Some("./bench".to_string()),
288288
}),
289-
targets: None,
289+
benchmarks: None,
290290
};
291291

292292
assert!(config.validate().is_ok());

src/run/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ pub async fn run(
235235
let run_target = if args.command.is_empty() {
236236
// No command provided - check for targets in project config
237237
let targets = project_config
238-
.and_then(|c| c.targets.as_ref())
238+
.and_then(|c| c.benchmarks.as_ref())
239239
.filter(|t| !t.is_empty())
240240
.ok_or_else(|| {
241241
anyhow!("No command provided and no targets defined in codspeed.yaml")

0 commit comments

Comments
 (0)