Skip to content

Commit 14364ef

Browse files
author
Sergey
committed
docs: record unit-test invocation and e2e component routing
- AGENTS.md documented only the E2E command; add the parallel unit one - note that ha_search routes to the component on every e2e lane
1 parent 6003977 commit 14364ef

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

AGENTS.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,16 @@ uv run hamcp-test-env --no-interactive # For automation
417417

418418
Test token centralized in `tests/test_constants.py`.
419419

420+
**Unit tests** (`tests/src/unit/`, no Docker) — run them in parallel, as CI does
421+
(`pr.yml`); serial takes 25+ minutes for ~11k tests:
422+
423+
```bash
424+
uv run pytest tests/src/unit/ -n auto --tb=short
425+
```
426+
427+
`tests/pytest.ini` sets `--maxfail=3`, so a run reporting "3 failed" has stopped
428+
early rather than finished — pass `--maxfail=0` when you need the full picture.
429+
420430
### Code Quality
421431

422432
C901 (mccabe complexity ≤10) is enforced repo-wide with zero per-file exemptions (issue #925 cleared the grandfathered list) — never reintroduce a `["C901"]` per-file-ignore; extract helpers instead.
@@ -896,7 +906,10 @@ empty, so the English a `tools` entry translates is read from the tool
896906
definition in `src/ha_mcp/tools/` — the `title=` kwarg and the summary
897907
paragraph of the docstring, or the `FEATURE_GATED_TOOLS` stub where a gated
898908
tool shows one instead. Editing that summary moves the English out from under
899-
six catalogs; the pipeline retranslates them. One deliberate exception: a
909+
six catalogs; the pipeline retranslates them. A parameter's
910+
`Field(description=...)` is NOT in the baseline — only the title and the
911+
docstring summary are — so editing one owes no translation work. One
912+
deliberate exception: a
900913
change to a feature-gated tool's PARSED docstring (its stub unchanged) is
901914
stub-review work, not translation work — the pipeline holds that baseline key
902915
stale, and the locale-sync run stays red until a human confirms the stub

tests/AGENTS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ testcontainer run).
3939
EVERY lane by `_install_custom_component`. A test may therefore rely on
4040
component-gated behaviour with no marker — e.g. a config entry's
4141
`unique_id`, which Home Assistant's own API never exposes on any endpoint.
42+
Consequence for `ha_search`: a query-driven call is served by the component's
43+
in-process scan, not the legacy REST path, so a test written for legacy-only
44+
behaviour passes *vacuously*. Naming a `search_types` the component does not
45+
serve (`"dashboard"`) sends the whole call down the legacy path.
4246
- **The in-process "server" config entry** of that same component (#1527) is
4347
the embedded backend only, seeded separately. That one IS lane-specific.
4448

0 commit comments

Comments
 (0)