From 44bb0662ae45fa96c8aa8dfe099c391728c3bd7b Mon Sep 17 00:00:00 2001 From: Cryptskii <47649969+cryptskii@users.noreply.github.com> Date: Tue, 29 Sep 2026 20:49:39 -0400 Subject: [PATCH] fix(ci): the storage layer names only SDK suites that exist A change that touches the storage node and not the SDK runs the `sdk-node-protocol` group, which named four SDK suites that no longer exist: - `b0x_integration` (deleted in #977) and `storage_full_lifecycle` (deleted in #932), integration targets. cargo refuses an unknown target, so the group failed on the first storage-only PR since then (#1069). - `sdk::storage_sync_sdk` and `sdk::storage_node_health`, lib filters. A filter that matches nothing runs nothing and passes, so these narrowed the group's coverage silently. The four names are removed. No SDK integration binary exercises the storage-node contract now, so the group runs one command: the four lib suites that do (`handlers::storage_routes`, `sdk::storage_node_sdk`, `sdk::b0x_sdk`, `sdk::storage_set`). The selector's self-test now refuses a lib filter that does not resolve to a module of dsm_sdk (`test_every_named_sdk_suite_is_a_module_that_exists`). Mutation control: `sdk::storage_sync_sdk` put back, the test is red. --- ci/layers.toml | 10 +++++----- ci/select_layers.py | 3 +-- ci/test_select_layers.py | 18 ++++++++++++++++-- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/ci/layers.toml b/ci/layers.toml index 0a01ec7c8..3e763ec4c 100644 --- a/ci/layers.toml +++ b/ci/layers.toml @@ -65,17 +65,17 @@ paths = [ paths = ["**/*.md"] # The SDK suites that exercise the storage-node contract: what a STORAGE -# change escalates to instead of every SDK unit test. +# change escalates to instead of every SDK unit test. Each is a module of +# dsm_sdk's library; the selector's self-test refuses a name that no longer +# resolves to one, because a filter that matches nothing runs nothing and +# still passes. [sdk_node_protocol] lib_filters = [ "handlers::storage_routes", "sdk::storage_node_sdk", "sdk::b0x_sdk", "sdk::storage_set", - "sdk::storage_sync_sdk", - "sdk::storage_node_health", ] -integration_tests = ["b0x_integration", "storage_full_lifecycle"] # The Rust test matrix groups the selector emits, and what each runs. [groups.dsm] @@ -90,7 +90,7 @@ run = "cargo test --locked -p dsm_sdk --release -- --nocapture --test-threads=1" [groups.sdk-node-protocol] when = ["SDK_NODE_PROTOCOL"] unless = ["SDK"] -run = "cargo test --locked -p dsm_sdk --release --lib -- --nocapture --test-threads=1 {lib_filters}\ncargo test --locked -p dsm_sdk --release {integration_tests} -- --nocapture --test-threads=1" +run = "cargo test --locked -p dsm_sdk --release --lib -- --nocapture --test-threads=1 {lib_filters}" [groups.workspace-rest] when = ["CORE", "STORAGE", "FORMAL"] diff --git a/ci/select_layers.py b/ci/select_layers.py index b54b70793..78283587f 100755 --- a/ci/select_layers.py +++ b/ci/select_layers.py @@ -117,14 +117,13 @@ def select(cfg: dict, files: list[str], event: str, preset: str | None) -> tuple def rust_matrix(cfg: dict, layers: set[str]) -> list[dict]: snp = cfg["sdk_node_protocol"] lib_filters = " ".join(snp["lib_filters"]) - integration = " ".join(f"--test {t}" for t in snp["integration_tests"]) include = [] for group, spec in cfg["groups"].items(): if not any(w in layers for w in spec["when"]): continue if any(u in layers for u in spec.get("unless", [])): continue - run = spec["run"].replace("{lib_filters}", lib_filters).replace("{integration_tests}", integration) + run = spec["run"].replace("{lib_filters}", lib_filters) include.append({"group": group, "run": run}) return include diff --git a/ci/test_select_layers.py b/ci/test_select_layers.py index 405727515..e74c769f1 100755 --- a/ci/test_select_layers.py +++ b/ci/test_select_layers.py @@ -61,8 +61,22 @@ def test_storage_reaches_its_node_protocol_sdk_coverage(self): self.assertEqual(layers, {"STORAGE", "SDK_NODE_PROTOCOL"}) self.assertEqual(groups(layers), {"sdk-node-protocol", "workspace-rest"}) run = next(g["run"] for g in sl.rust_matrix(CFG, layers) if g["group"] == "sdk-node-protocol") - self.assertIn("handlers::storage_routes", run) - self.assertIn("--test b0x_integration", run) + for module in CFG["sdk_node_protocol"]["lib_filters"]: + self.assertIn(module, run) + self.assertEqual(run.count("cargo test"), 1, run) + + def test_every_named_sdk_suite_is_a_module_that_exists(self): + # A cargo test filter that matches nothing runs nothing and passes, so + # a name left behind by a deleted module narrows STORAGE's coverage + # without a signal. Each name must resolve to a module of the library. + root = Path(__file__).resolve().parent.parent + src = root / "dsm_client/deterministic_state_machine/dsm_sdk/src" + for module in CFG["sdk_node_protocol"]["lib_filters"]: + path = src.joinpath(*module.split("::")) + self.assertTrue( + path.with_suffix(".rs").is_file() or (path / "mod.rs").is_file(), + f"{module} names no module of dsm_sdk", + ) def test_storage_plus_sdk_runs_full_sdk_not_the_narrow_group(self): layers, _ = sel(["dsm_storage_node/src/main.rs", SDK + "sdk/token_sdk.rs"])