v0.3.6-pre.005
This commit is contained in:
61
crates/ksp-job-backfill-lib/tests/release_completeness.rs
Normal file
61
crates/ksp-job-backfill-lib/tests/release_completeness.rs
Normal file
@@ -0,0 +1,61 @@
|
||||
// file: crates/ksp-job-backfill-lib/tests/release_completeness.rs
|
||||
// version: 1
|
||||
|
||||
//! Completeness canaries for the `pre.005` Backfill foundation.
|
||||
|
||||
#[test]
|
||||
fn pre_005_production_module_inventory_is_exact() -> std::io::Result<()> {
|
||||
let source_root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("src");
|
||||
let entries = match std::fs::read_dir(source_root) {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
let mut names = std::vec::Vec::new();
|
||||
for entry in entries {
|
||||
let entry = match entry {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
let file_type = match entry.file_type() {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
||||
};
|
||||
if !file_type.is_file() {
|
||||
continue;
|
||||
}
|
||||
let name = match entry.file_name().into_string() {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(_) => continue,
|
||||
};
|
||||
if name.ends_with(".rs") {
|
||||
names.push(name);
|
||||
}
|
||||
}
|
||||
names.sort_unstable();
|
||||
assert_eq!(names, std::vec!["constants.rs", "discovery.rs", "error.rs", "lib.rs", "request.rs"]);
|
||||
return std::result::Result::Ok(());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pre_005_surface_is_discovery_only_without_raw_persistence_or_checkpoint_runtime() {
|
||||
let root = include_str!("../src/lib.rs");
|
||||
for required in [
|
||||
"BackfillCandidate",
|
||||
"BackfillCandidateIdentity",
|
||||
"BackfillCommitment",
|
||||
"BackfillDiscovery",
|
||||
"BackfillDiscoveryBoundary",
|
||||
"BackfillRequest",
|
||||
"BackfillScope",
|
||||
"BackfillScopeFingerprint",
|
||||
"BackfillSignature",
|
||||
"discover_backfill_candidates",
|
||||
] {
|
||||
assert!(root.contains(required), "required pre.005 public contract missing: {required}");
|
||||
}
|
||||
for forbidden in ["RawTransactionObservation", "persist_raw_transaction_acquisition", "BackfillCheckpoint", "BackfillJobHandle", "JobSnapshotSource"] {
|
||||
assert!(!root.contains(forbidden), "later Backfill tranche leaked into pre.005: {forbidden}");
|
||||
}
|
||||
assert!(!root.contains("pub mod "));
|
||||
return;
|
||||
}
|
||||
Reference in New Issue
Block a user