use super::*;
#[test]
fn the_shipped_worker_grant_is_the_whole_tool_pool() {
let raw = crate::template::TEMPLATE
.get_file("providers.yaml")
.expect("the template ships providers.yaml")
.contents_utf8()
.expect("providers.yaml is UTF-8");
let shipped = crate::config::PerRepoProviders::parse(raw, Path::new("template/providers.yaml"))
.expect("the shipped template parses");
let mut granted = shipped.roles["worker"].tools.clone();
granted.sort();
let mut pool: Vec<String> = TOOLS
.files()
.map(|f| {
f.path()
.file_stem()
.expect("a pooled schema has a stem")
.to_string_lossy()
.into_owned()
})
.collect();
pool.sort();
assert_eq!(
granted, pool,
"template/providers.yaml's worker `tools:` must grant every tool \
schemas/tools/ ships (ARCH §4.3)"
);
assert!(shipped.roles["compactor"].tools.is_empty());
}
#[test]
fn the_shipped_compactor_entry_composes_the_summary_chain() {
let raw = crate::template::TEMPLATE
.get_file("manifest.yaml")
.expect("the template ships manifest.yaml")
.contents_utf8()
.expect("manifest.yaml is UTF-8");
let shipped =
crate::config::manifest::Manifest::parse(raw, Path::new("template/manifest.yaml"))
.expect("the shipped template parses");
assert_eq!(shipped.roles["compactor"].order, vec!["summary/**"]);
}