|
39 | 39 | "app.services.docker_control_client", |
40 | 40 | "app.services.minio_service", |
41 | 41 | } |
| 42 | +LEGACY_NODE_DB_UTILITY_MODULES = { |
| 43 | + "app.node.core.db_utils", |
| 44 | +} |
42 | 45 | LEGACY_WORKFLOW_SERVICE_MODULES = { |
43 | 46 | "app.services.workflow_agent_drafts", |
44 | 47 | "app.services.workflow_agent_response", |
@@ -119,6 +122,18 @@ def test_datasource_domain_does_not_depend_on_tools_layer() -> None: |
119 | 122 | assert violations == [] |
120 | 123 |
|
121 | 124 |
|
| 125 | +def test_datasource_domain_does_not_depend_on_node_layer() -> None: |
| 126 | + violations: list[str] = [] |
| 127 | + for path in sorted(DATASOURCE_DIR.rglob("*.py")): |
| 128 | + if path.name == "__init__.py": |
| 129 | + continue |
| 130 | + for module in sorted(_imported_modules(path)): |
| 131 | + if module == "app.node" or module.startswith("app.node."): |
| 132 | + violations.append(f"{path.relative_to(APP_DIR)} imports {module}") |
| 133 | + |
| 134 | + assert violations == [] |
| 135 | + |
| 136 | + |
122 | 137 | def test_runtime_domain_does_not_depend_on_tools_layer() -> None: |
123 | 138 | violations: list[str] = [] |
124 | 139 | for path in sorted(RUNTIME_DIR.rglob("*.py")): |
@@ -222,6 +237,16 @@ def test_moved_deploy_and_infra_services_use_domain_import_paths() -> None: |
222 | 237 | assert violations == [] |
223 | 238 |
|
224 | 239 |
|
| 240 | +def test_moved_database_helpers_use_infra_import_paths() -> None: |
| 241 | + violations: list[str] = [] |
| 242 | + for path in sorted(APP_DIR.rglob("*.py")): |
| 243 | + legacy_imports = sorted(_imported_modules(path) & LEGACY_NODE_DB_UTILITY_MODULES) |
| 244 | + for module in legacy_imports: |
| 245 | + violations.append(f"{path.relative_to(APP_DIR)} imports {module}") |
| 246 | + |
| 247 | + assert violations == [] |
| 248 | + |
| 249 | + |
225 | 250 | def test_moved_datasource_services_use_domain_import_paths() -> None: |
226 | 251 | violations: list[str] = [] |
227 | 252 | for path in sorted(APP_DIR.rglob("*.py")): |
|
0 commit comments