Skip to content

Commit d4bf645

Browse files
Add architecture guard for agent example coverage
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent aab8f54 commit d4bf645

3 files changed

Lines changed: 26 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ This runs lint, format checks, compile checks, tests, and package build.
7676
- Keep sync/async behavior in parity where applicable.
7777
- Prefer deterministic unit tests over network-dependent tests.
7878
- Preserve architectural guardrails with focused tests. Current guard suites include:
79+
- `tests/test_agent_examples_coverage.py` (agent task example coverage enforcement),
7980
- `tests/test_agent_payload_helper_usage.py` (shared agent start-payload helper usage enforcement),
8081
- `tests/test_agent_terminal_status_helper_usage.py` (shared agent terminal-status helper usage enforcement),
8182
- `tests/test_architecture_marker_usage.py` (architecture marker coverage across guard modules),
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from pathlib import Path
2+
3+
import pytest
4+
5+
pytestmark = pytest.mark.architecture
6+
7+
8+
EXPECTED_AGENT_EXAMPLES = (
9+
"async_browser_use_task.py",
10+
"async_claude_computer_use_task.py",
11+
"async_cua_task.py",
12+
"async_gemini_computer_use_task.py",
13+
"async_hyper_agent_task.py",
14+
"sync_browser_use_task.py",
15+
"sync_claude_computer_use_task.py",
16+
"sync_cua_task.py",
17+
"sync_gemini_computer_use_task.py",
18+
"sync_hyper_agent_task.py",
19+
)
20+
21+
22+
def test_agent_examples_cover_all_agent_task_managers():
23+
example_names = {path.name for path in Path("examples").glob("*.py")}
24+
assert set(EXPECTED_AGENT_EXAMPLES).issubset(example_names)

tests/test_architecture_marker_usage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77

88
ARCHITECTURE_GUARD_MODULES = (
9+
"tests/test_agent_examples_coverage.py",
910
"tests/test_agent_payload_helper_usage.py",
1011
"tests/test_agent_terminal_status_helper_usage.py",
1112
"tests/test_guardrail_ast_utils.py",

0 commit comments

Comments
 (0)