Skip to content

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

Merged
teknium1 merged 1 commit intoNousResearch: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 intoNousResearch:mainfrom
0xbyt4:test/reorganize-and-add-unit-tests

Conversation

@0xbyt4
Copy link
Copy Markdown
Contributor

@0xbyt4 0xbyt4 commented Feb 26, 2026

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants