fix(repo):统一发布健康与只读质量门禁
bat-rust / Build and test Rust (push) Canceled after 0s
bat-rust / Build and test Go API (push) Canceled after 0s

This commit is contained in:
2026-09-13 22:09:44 +08:00
parent 32fc64fa83
commit c17904ee1c
25 changed files with 869 additions and 184 deletions
+28
View File
@@ -1697,6 +1697,34 @@ mod tests {
assert!(!localized.unknown);
assert_eq!(report.releases.len(), 2);
let other_path = official_version.join("other.bin");
let other_bytes = fs::read(&other_path).unwrap();
let mut same_size_corruption = other_bytes.clone();
same_size_corruption[0] ^= 0xff;
fs::write(&other_path, &same_size_corruption).unwrap();
let same_size_report =
build_release_status(&official_root, &localized_root, Path::new("unzip")).unwrap();
let same_size_official = same_size_report
.releases
.iter()
.find(|release| release.channel == "official" && release.current)
.unwrap();
assert_eq!(same_size_official.distribution_integrity_status, "invalid");
assert!(!same_size_report.official_distribution_ready);
fs::write(&other_path, &other_bytes).unwrap();
fs::write(&other_path, [other_bytes.as_slice(), b"!"].concat()).unwrap();
let size_report =
build_release_status(&official_root, &localized_root, Path::new("unzip")).unwrap();
assert!(!size_report.official_distribution_ready);
fs::write(&other_path, &other_bytes).unwrap();
fs::remove_file(&other_path).unwrap();
let missing_report =
build_release_status(&official_root, &localized_root, Path::new("unzip")).unwrap();
assert!(!missing_report.official_distribution_ready);
fs::write(&other_path, &other_bytes).unwrap();
fs::remove_file(official_version.join(crate::OFFICIAL_DISTRIBUTION_PUBLICATION_FILE))
.unwrap();
let missing_publication = select_release_distribution(