diff options
Diffstat (limited to 'tests/layers.rs')
| -rw-r--r-- | tests/layers.rs | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/tests/layers.rs b/tests/layers.rs index 548f475..8566584 100644 --- a/tests/layers.rs +++ b/tests/layers.rs @@ -1,12 +1,3 @@ -//! The dependency direction between modules (ยง6 M-6, M-7). -//! -//! These are not style rules. The review found the persistence layer naming a -//! type from the VCS watcher, and the reviewer's risk scorer calling back into -//! the watcher for a recipe question โ two edges pointing up the stack, which -//! makes `db` and `watch` mutually dependent and means any change to one is a -//! change to the other. A layering rule that is only written down gets violated -//! by the next reasonable-looking commit, so it is a test here. - use std::path::{Path, PathBuf}; fn src_root() -> PathBuf { @@ -57,9 +48,8 @@ fn edges(dir: &str, forbidden: &[&str]) -> Vec<String> { #[test] fn persistence_names_nothing_above_itself() { - // M-6: `db::stage_b_cache_get` used to return `watch::upstream::StageB`, so - // the storage layer could not be understood without the watcher. The row - // type is `db::model::StageBCacheRow` now and the watcher converts. + // M-6: `db::stage_b_cache_get` used to return `watch::upstream::StageB`, so the + // storage layer could not be understood without the watcher. let hits = edges("db", &["watch", "review", "pipeline", "http", "ops", "shims"]); assert!(hits.is_empty(), "src/db depends upward on the modules above it:\n{hits:#?}"); } @@ -67,9 +57,8 @@ fn persistence_names_nothing_above_itself() { #[test] fn review_does_not_call_back_into_the_watcher() { // M-7: `review::risk` called `watch::digests::skip_on_non_vcs` while - // `watch::detect` called `review::candidates` โ a cycle. Whether a recipe - // skips verification is a recipe question, so `recipe::skip_on_non_vcs` is - // where it lives and both sides look down, not sideways. + // `watch::detect` called `review::candidates` โ a cycle. It now lives in + // `recipe`, and both sides look down, not sideways. let hits = edges("review", &["watch", "pipeline", "http"]); assert!(hits.is_empty(), "src/review depends on modules beside or above it:\n{hits:#?}"); } @@ -82,8 +71,7 @@ fn the_watcher_does_not_reach_into_the_pipeline_or_the_ui() { #[test] fn the_recipe_leaf_depends_on_nothing_above_it() { - // `recipe` is a leaf: parsing and recipe-shaped questions. Everything else - // is allowed to ask it; it may ask nothing. + // `recipe` is a leaf: everything else may ask it; it may ask nothing. let text = std::fs::read_to_string(src_root().join("recipe.rs")).expect("read recipe.rs"); for m in ["watch", "review", "pipeline", "http", "ops", "shims"] { assert!( |
