pub fn observe_coverage(root: &Path) -> CoverageObservationExpand description
The coverage record scripts/rust-coverage left, read as it is: one small file, no git.
use majordomus_cli::environment::preflight::{observe_coverage, CoverageObservation, COVERAGE_RECORD};
let dir = tempfile::tempdir().unwrap();
// nothing measured yet is absent, not an error
assert_eq!(observe_coverage(dir.path()), CoverageObservation::Absent);
let path = dir.path().join(COVERAGE_RECORD);
std::fs::create_dir_all(path.parent().unwrap()).unwrap();
std::fs::write(&path, r#"{"schema": 9}"#).unwrap();
assert!(matches!(observe_coverage(dir.path()), CoverageObservation::Unreadable(_)));