mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 01:21:43 +00:00
test: remove 169 change-detector tests across 21 files (#11472)
First pass of test-suite reduction to address flaky CI and bloat. Removed tests that fall into these change-detector patterns: 1. Source-grep tests (tests/gateway/test_feishu.py, test_email.py): tests that call inspect.getsource() on production modules and grep for string literals. Break on any refactor/rename even when behavior is correct. 2. Platform enum tautologies (every gateway/test_X.py): assertions like `Platform.X.value == 'x'` duplicated across ~9 adapter test files. 3. Toolset/PLATFORM_HINTS/setup-wizard registry-presence checks: tests that only verify a key exists in a dict. Data-layout tests, not behavior. 4. Argparse wiring tests (test_argparse_flag_propagation, test_subparser_routing _fallback): tests that do parser.parse_args([...]) then assert args.field. Tests Python's argparse, not our code. 5. Pure dispatch tests (test_plugins_cmd.TestPluginsCommandDispatch): patch cmd_X, call plugins_command with matching action, assert mock called. Tests the if/elif chain, not behavior. 6. Kwarg-to-mock verification (test_auxiliary_client ~45 tests, test_web_tools_config, test_gemini_cloudcode, test_retaindb_plugin): tests that mock the external API client, call our function, and assert exact kwargs. Break on refactor even when behavior is preserved. 7. Schedule-internal "function-was-called" tests (acp/test_server scheduling tests): tests that patch own helper method, then assert it was called. Kept behavioral tests throughout: error paths (pytest.raises), security tests (path traversal, SSRF, redaction), message alternation invariants, provider API format conversion, streaming logic, memory contract, real config load/merge tests. Net reduction: 169 tests removed. 38 empty classes cleaned up. Collected before: 12,522 tests Collected after: 12,353 tests
This commit is contained in:
parent
e33cb65a98
commit
2367c6ffd5
21 changed files with 0 additions and 1946 deletions
|
|
@ -57,85 +57,6 @@ def _build_parser():
|
|||
return parser
|
||||
|
||||
|
||||
class TestFlagBeforeSubcommand:
|
||||
"""Flags placed before 'chat' must propagate through."""
|
||||
|
||||
def test_yolo_before_chat(self):
|
||||
parser = _build_parser()
|
||||
args = parser.parse_args(["--yolo", "chat"])
|
||||
assert getattr(args, "yolo", False) is True
|
||||
|
||||
def test_worktree_before_chat(self):
|
||||
parser = _build_parser()
|
||||
args = parser.parse_args(["-w", "chat"])
|
||||
assert getattr(args, "worktree", False) is True
|
||||
|
||||
def test_skills_before_chat(self):
|
||||
parser = _build_parser()
|
||||
args = parser.parse_args(["-s", "myskill", "chat"])
|
||||
assert getattr(args, "skills", None) == ["myskill"]
|
||||
|
||||
def test_pass_session_id_before_chat(self):
|
||||
parser = _build_parser()
|
||||
args = parser.parse_args(["--pass-session-id", "chat"])
|
||||
assert getattr(args, "pass_session_id", False) is True
|
||||
|
||||
def test_resume_before_chat(self):
|
||||
parser = _build_parser()
|
||||
args = parser.parse_args(["-r", "abc123", "chat"])
|
||||
assert getattr(args, "resume", None) == "abc123"
|
||||
|
||||
|
||||
class TestFlagAfterSubcommand:
|
||||
"""Flags placed after 'chat' must still work."""
|
||||
|
||||
def test_yolo_after_chat(self):
|
||||
parser = _build_parser()
|
||||
args = parser.parse_args(["chat", "--yolo"])
|
||||
assert getattr(args, "yolo", False) is True
|
||||
|
||||
def test_worktree_after_chat(self):
|
||||
parser = _build_parser()
|
||||
args = parser.parse_args(["chat", "-w"])
|
||||
assert getattr(args, "worktree", False) is True
|
||||
|
||||
def test_skills_after_chat(self):
|
||||
parser = _build_parser()
|
||||
args = parser.parse_args(["chat", "-s", "myskill"])
|
||||
assert getattr(args, "skills", None) == ["myskill"]
|
||||
|
||||
def test_resume_after_chat(self):
|
||||
parser = _build_parser()
|
||||
args = parser.parse_args(["chat", "-r", "abc123"])
|
||||
assert getattr(args, "resume", None) == "abc123"
|
||||
|
||||
|
||||
class TestNoSubcommandDefaults:
|
||||
"""When no subcommand is given, flags must work and defaults must hold."""
|
||||
|
||||
def test_yolo_no_subcommand(self):
|
||||
parser = _build_parser()
|
||||
args = parser.parse_args(["--yolo"])
|
||||
assert args.yolo is True
|
||||
assert args.command is None
|
||||
|
||||
def test_defaults_no_flags(self):
|
||||
parser = _build_parser()
|
||||
args = parser.parse_args([])
|
||||
assert getattr(args, "yolo", False) is False
|
||||
assert getattr(args, "worktree", False) is False
|
||||
assert getattr(args, "skills", None) is None
|
||||
assert getattr(args, "resume", None) is None
|
||||
|
||||
def test_defaults_chat_no_flags(self):
|
||||
parser = _build_parser()
|
||||
args = parser.parse_args(["chat"])
|
||||
# With SUPPRESS, these fall through to parent defaults
|
||||
assert getattr(args, "yolo", False) is False
|
||||
assert getattr(args, "worktree", False) is False
|
||||
assert getattr(args, "skills", None) is None
|
||||
|
||||
|
||||
class TestYoloEnvVar:
|
||||
"""Verify --yolo sets HERMES_YOLO_MODE regardless of flag position.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue