Skip to content

test: reorganize test structure and add missing unit tests#34

Merged
teknium1 merged 1 commit into
NousResearch:mainfrom
0xbyt4:test/reorganize-and-add-unit-tests
Feb 26, 2026
Merged

test: reorganize test structure and add missing unit tests#34
teknium1 merged 1 commit into
NousResearch:mainfrom
0xbyt4:test/reorganize-and-add-unit-tests

Conversation

@0xbyt4

@0xbyt4 0xbyt4 commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Reorganize flat tests/ directory to mirror source code structure (tools/, gateway/, hermes_cli/, integration/)
  • Add 11 new test files covering previously untested modules
  • Add pytest integration marker to gate external-service tests

New Test Architecture

tests/
├── conftest.py                        # Shared fixtures (tmp_dir, mock_config)
│
├── tools/                             # mirrors tools/ source
│   ├── test_registry.py               # NEW  - 10 tests  ← registry.py
│   ├── test_patch_parser.py           # NEW  -  8 tests  ← patch_parser.py
│   ├── test_fuzzy_match.py            # NEW  -  9 tests  ← fuzzy_match.py
│   ├── test_todo_tool.py              # NEW  - 11 tests  ← todo_tool.py
│   ├── test_approval.py               # NEW  - 14 tests  ← approval.py
│   ├── test_file_tools.py             # NEW  -  9 tests  ← file_tools.py
│   ├── test_code_execution.py         # MOVED - 18 tests
│   ├── test_delegate.py               # MOVED - 22 tests
│   └── test_interrupt.py              # MOVED -  6 tests
│                                                107 unit tests
│
├── gateway/                           # mirrors gateway/ source
│   ├── test_session.py                # NEW  -  6 tests  ← session.py
│   ├── test_config.py                 # NEW  -  8 tests  ← config.py
│   └── test_delivery.py               # NEW  - 15 tests  ← delivery.py
│                                                 29 unit tests
│
├── hermes_cli/                        # mirrors hermes_cli/ source
│   ├── test_config.py                 # NEW  -  6 tests  ← config.py
│   └── test_models.py                 # NEW  -  5 tests  ← models.py
│                                                 11 unit tests
│
└── integration/                       # tests requiring external services
    ├── test_web_tools.py              # MOVED (requires FIRECRAWL_API_KEY)
    ├── test_modal_terminal.py         # MOVED (requires Modal backend)
    ├── test_batch_runner.py           # MOVED (manual script)
    └── test_checkpoint_resumption.py  # MOVED (requires batch_runner)

Before: 7 test files in flat tests/, ~86 tests, ~10% coverage
After: 18 test files in organized structure, 147 unit tests + 14 integration tests

What changed

Change Files
New test files 11 (conftest + 6 tools + 3 gateway + 2 hermes_cli)
Moved test files 7 (3 → tools/, 4 → integration/)
New __init__.py 4 (tools, gateway, hermes_cli, integration)
Updated pyproject.toml (pytest markers + addopts)

Running tests

# Unit tests only (default, excludes integration)
uv run pytest -v

# Specific module
uv run pytest tests/tools/ -v
uv run pytest tests/gateway/ -v
uv run pytest tests/hermes_cli/ -v

# Integration tests (requires API keys / external services)
uv run pytest -m integration -v

# Everything
uv run pytest -m '' -v

Test plan

  • uv run pytest tests/tools/ -v — 107 passed
  • uv run pytest tests/gateway/ -v — 29 passed
  • uv run pytest tests/hermes_cli/ -v — 11 passed
  • uv run pytest -v — 147 passed, 9 deselected (integration)
  • uv run pytest -m integration --collect-only — 9 collected correctly

Reorganize flat tests/ directory to mirror source code structure
(tools/, gateway/, hermes_cli/, integration/). Add 11 new test files
covering previously untested modules: registry, patch_parser,
fuzzy_match, todo_tool, approval, file_tools, gateway session/config/
delivery, and hermes_cli config/models. Total: 147 unit tests passing,
9 integration tests gated behind pytest marker.
@teknium1

Copy link
Copy Markdown
Contributor

LGTM!

@teknium1 teknium1 merged commit dcf370c into NousResearch:main Feb 26, 2026
sudo-yf pushed a commit to sudo-yf/hermes-agent that referenced this pull request Apr 5, 2026
Sprint 19: Password auth, security headers, login page (Issue NousResearch#23)
h4x3rotab pushed a commit to Clawdi-AI/hermes-agent that referenced this pull request Apr 10, 2026
maiixu added a commit to maiixu/hermes-agent that referenced this pull request Apr 13, 2026
…legram notification

- _spawn_cc: catch TimeoutExpired, return timed_out=True
- _notify_failure: haiku summarises stdout, sends Telegram via home channel
- _action_address_comments: detect timeout/exit!=0/blocked, call _notify_failure

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
linxule added a commit to linxule/hermes-agent that referenced this pull request Apr 27, 2026
Doc-parity with linxule/hermes-kimi-plugin's NousResearch#34 docstring expansion at
the same init site. Two-path architecture (adapter.send() vs the module-
level send_kimi_message helper) made explicit; when-to-use guidance for
group rooms vs DMs; failure modes when the agent isn't system-prompted to
call send_message_tool.

Comment-only — no runtime behaviour change. Keeps this legacy variant
useful as an inspection ref alongside the standalone plugin.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…d-unit-tests

test: reorganize test structure and add missing unit tests
olympus-terminal pushed a commit to olympus-terminal/hermes-agent that referenced this pull request May 16, 2026
…d-unit-tests

test: reorganize test structure and add missing unit tests
dizhaky added a commit to dizhaky/hermes-agent that referenced this pull request Jun 4, 2026
- path-to-regexp: 0.1.12 → 0.1.13 (CVE-2026-4867, GHSA-37ch-88jc-xwx2)
- picomatch: 2.3.1 → 2.3.2 (CVE-2026-33671, GHSA-c2c7-rcm5-vvqj)
- undici: 7.23.0 → 7.27.1 (CVE-2026-1526/CVE-2026-2229/CVE-2026-1528)
- serialize-javascript: 6.0.2 → 7.0.3 (GHSA-5c6j-r48x-rmvq, via overrides)

Fixes Dependabot alerts NousResearch#37, NousResearch#34, NousResearch#33, NousResearch#32, NousResearch#29, NousResearch#27
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…d-unit-tests

test: reorganize test structure and add missing unit tests
adrozdenko pushed a commit to adrozdenko/hermes-agent that referenced this pull request Jun 10, 2026
…tdin

Deploy NousResearch#34: the lock itself engaged (allow_anon=false, hermes key loaded,
confirmed by the /health dump in the failure diagnostics), but the post-flip
gate probe ran 'docker exec' without -i — the heredoc never reached python3's
stdin, the probe printed nothing, and the empty output failed the LOCK_OK
check, falsely redding an otherwise successful cutover. The wire step already
used -i; the gate now does too, so the 401/keyed-auth probes actually run.

https://claude.ai/code/session_018vp1LDdpoaRLCNZQRsnAp8
jarvis-stark-ops added a commit to 1Team-Engineering/hermes-agent that referenced this pull request Jun 10, 2026
…arch#34, NousResearch#65)

- NousResearch#33 GH_TOKEN propagation: _inject_gh_token_into_env runs `gh auth
  token` before each worker subprocess.Popen and injects into env if
  the worker doesn't have GH_TOKEN/GITHUB_TOKEN.
- NousResearch#34 respawn_guarded active_pr exempts review roles (tony/tchalla/
  vision/reviewer). Bounded: exemption only applies while
  consecutive_failures < max_retries; once exhausted the guard fires.
- NousResearch#65 fabricated github-auth block claims rejected:
  FabricatedAuthClaimError raised when kanban_block reason matches
  auth-claim pattern AND dispatcher's `gh auth status` succeeds.
  Strict leading-position regex with cause:/blocker:/reason:/infra:
  prefix exemption.

Context: hermes-jarvis#61. 33 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants