fix: require manifests for licensed gates
Docs Deploy / Build and Deploy MkDocs (push) Successful in 35s
Test / Lint (push) Failing after 1m16s
Test / Test (push) Has been skipped
Test / Render parity (push) Has been skipped

This commit is contained in:
2026-06-22 17:29:33 +04:00
parent 0b23cf48e7
commit 162de8ccab
17 changed files with 493 additions and 167 deletions
+17 -12
View File
@@ -1239,9 +1239,7 @@ mod tests {
#[ignore = "requires licensed corpus"]
fn licensed_corpus_msh_assets_validate() {
for (corpus, expected) in [("IS", 435_usize), ("IS2", 511_usize)] {
let Some(root) = corpus_root(corpus) else {
continue;
};
let root = corpus_root(corpus);
let mut count = 0usize;
for path in files_under(&root) {
let Ok(bytes) = std::fs::read(&path) else {
@@ -1304,9 +1302,7 @@ mod tests {
13_040_438_305_408_523_893_u64,
),
] {
let Some(root) = corpus_root(corpus) else {
continue;
};
let root = corpus_root(corpus);
let mut models = 0usize;
let mut animated_models = 0usize;
let mut node_samples = 0usize;
@@ -1725,12 +1721,21 @@ mod tests {
name.len() >= 4 && name[name.len() - 4..].eq_ignore_ascii_case(b".msh")
}
fn corpus_root(name: &str) -> Option<PathBuf> {
let root = Path::new(env!("CARGO_MANIFEST_DIR"))
.join("../..")
.join("testdata")
.join(name);
root.is_dir().then_some(root)
fn corpus_root(name: &str) -> PathBuf {
let variable = match name {
"IS" => "FPARKAN_CORPUS_PART1_ROOT",
"IS2" => "FPARKAN_CORPUS_PART2_ROOT",
_ => panic!("unknown licensed corpus part: {name}"),
};
let root = std::env::var_os(variable)
.map(PathBuf::from)
.unwrap_or_else(|| panic!("{variable} is required for licensed corpus tests"));
assert!(
root.is_dir(),
"licensed corpus root is missing: {}",
root.display()
);
root
}
fn files_under(root: &Path) -> Vec<PathBuf> {