Skip to content

Commit

Permalink
test: check for unknown settings
Browse files Browse the repository at this point in the history
  • Loading branch information
CLEMENTINATOR committed Feb 13, 2025
1 parent b743cbf commit c233d77
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/cli/src/commands/components/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,18 @@ async fn test_data_collection_component(opts: Options) -> anyhow::Result<()> {
}

// check that all required settings are provided
for (name, setting) in manifest.package.settings {
if setting.required && !settings_map.contains_key(&name) {
for (name, setting) in &manifest.package.settings {
if setting.required && !settings_map.contains_key(name) {
return Err(anyhow::anyhow!("missing required setting {}", name));
}
}

for name in settings_map.keys() {
if !manifest.package.settings.contains_key(name) {
return Err(anyhow::anyhow!("unknown setting {}", name));
}
}

let settings = settings_map.clone().into_iter().collect();
// select events to run
let mut events = vec![];
Expand Down

0 comments on commit c233d77

Please sign in to comment.