Skip to content

Commit aab8f54

Browse files
Enforce started-job primitive centralization boundary
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent 7f1376e commit aab8f54

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ This runs lint, format checks, compile checks, tests, and package build.
113113
- `tests/test_session_profile_update_helper_usage.py` (session profile-update parameter helper usage enforcement),
114114
- `tests/test_session_upload_helper_usage.py` (session upload-input normalization helper usage enforcement),
115115
- `tests/test_start_job_context_helper_usage.py` (shared started-job context helper usage enforcement),
116+
- `tests/test_started_job_helper_boundary.py` (centralization boundary enforcement for started-job helper primitives),
116117
- `tests/test_tool_mapping_reader_usage.py` (tools mapping-helper usage),
117118
- `tests/test_type_utils_usage.py` (type `__mro__` boundary centralization in `hyperbrowser/type_utils.py`),
118119
- `tests/test_web_pagination_internal_reuse.py` (web pagination helper internal reuse of shared job pagination helpers),

tests/test_architecture_marker_usage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"tests/test_session_profile_update_helper_usage.py",
4646
"tests/test_session_upload_helper_usage.py",
4747
"tests/test_start_job_context_helper_usage.py",
48+
"tests/test_started_job_helper_boundary.py",
4849
"tests/test_web_pagination_internal_reuse.py",
4950
"tests/test_web_payload_helper_usage.py",
5051
)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from pathlib import Path
2+
3+
import pytest
4+
5+
pytestmark = pytest.mark.architecture
6+
7+
8+
MANAGERS_DIR = Path("hyperbrowser/client/managers")
9+
10+
11+
def test_started_job_context_primitives_are_centralized():
12+
violating_modules: list[str] = []
13+
for module_path in sorted(MANAGERS_DIR.rglob("*.py")):
14+
if module_path.name in {"__init__.py", "start_job_utils.py"}:
15+
continue
16+
module_text = module_path.read_text(encoding="utf-8")
17+
if "ensure_started_job_id(" in module_text or "build_operation_name(" in module_text:
18+
violating_modules.append(module_path.as_posix())
19+
20+
assert violating_modules == []

0 commit comments

Comments
 (0)