b4fbd6fe9f
Deploy Site / deploy-vercel (push) Has been skipped
Deploy Site / deploy-docs (push) Has been skipped
Build Skills Index / build-index (push) Has been skipped
CI / Deny unrelated histories (push) Has been skipped
CI / Detect affected areas (push) Successful in 27m35s
CI / OSV scan (push) Failing after 4s
CI / Build&Test Docker image (push) Successful in 9s
CI / Supply-chain scan (push) Has been skipped
CI / Lint Docker scripts (push) Failing after 5m13s
CI / Check contributors (push) Failing after 12m8s
CI / Docs Site (push) Failing after 12m8s
CI / TypeScript (push) Failing after 12m8s
CI / Python lints (push) Failing after 12m9s
CI / Python tests (push) Failing after 12m9s
CI / Check uv.lock (push) Failing after 23m22s
CI / CI timing report (push) Has been cancelled
Build Skills Index / trigger-deploy (push) Has been cancelled
CI / All required checks pass (push) Has been cancelled
88 lines
2.5 KiB
Python
88 lines
2.5 KiB
Python
"""Tests for `hermes curator run` CLI behavior."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from types import SimpleNamespace
|
|
|
|
|
|
def _args(**kwargs):
|
|
values = {
|
|
"dry_run": False,
|
|
"synchronous": False,
|
|
"background": False,
|
|
}
|
|
values.update(kwargs)
|
|
return SimpleNamespace(**values)
|
|
|
|
|
|
def test_run_defaults_to_synchronous(monkeypatch, capsys):
|
|
import agent.curator as curator_state
|
|
import hermes_cli.curator as curator_cli
|
|
|
|
calls = []
|
|
monkeypatch.setattr(curator_state, "is_enabled", lambda: True)
|
|
monkeypatch.setattr(
|
|
curator_state,
|
|
"run_curator_review",
|
|
lambda **kwargs: calls.append(kwargs) or {"auto_transitions": {}},
|
|
)
|
|
|
|
assert curator_cli._cmd_run(_args()) == 0
|
|
|
|
assert calls[0]["synchronous"] is True
|
|
assert calls[0]["dry_run"] is False
|
|
assert "background" not in capsys.readouterr().out
|
|
|
|
|
|
def test_run_background_opts_into_async(monkeypatch, capsys):
|
|
import agent.curator as curator_state
|
|
import hermes_cli.curator as curator_cli
|
|
|
|
calls = []
|
|
monkeypatch.setattr(curator_state, "is_enabled", lambda: True)
|
|
monkeypatch.setattr(
|
|
curator_state,
|
|
"run_curator_review",
|
|
lambda **kwargs: calls.append(kwargs) or {"auto_transitions": {}},
|
|
)
|
|
|
|
assert curator_cli._cmd_run(_args(background=True)) == 0
|
|
|
|
assert calls[0]["synchronous"] is False
|
|
assert "llm pass running in background" in capsys.readouterr().out
|
|
|
|
|
|
def test_run_sync_wins_over_background(monkeypatch):
|
|
import agent.curator as curator_state
|
|
import hermes_cli.curator as curator_cli
|
|
|
|
calls = []
|
|
monkeypatch.setattr(curator_state, "is_enabled", lambda: True)
|
|
monkeypatch.setattr(
|
|
curator_state,
|
|
"run_curator_review",
|
|
lambda **kwargs: calls.append(kwargs) or {"auto_transitions": {}},
|
|
)
|
|
|
|
assert curator_cli._cmd_run(_args(synchronous=True, background=True)) == 0
|
|
|
|
assert calls[0]["synchronous"] is True
|
|
|
|
|
|
def test_dry_run_default_reports_synchronous_wording(monkeypatch, capsys):
|
|
import agent.curator as curator_state
|
|
import hermes_cli.curator as curator_cli
|
|
|
|
monkeypatch.setattr(curator_state, "is_enabled", lambda: True)
|
|
monkeypatch.setattr(
|
|
curator_state,
|
|
"run_curator_review",
|
|
lambda **kwargs: {"auto_transitions": {}},
|
|
)
|
|
|
|
assert curator_cli._cmd_run(_args(dry_run=True)) == 0
|
|
|
|
out = capsys.readouterr().out
|
|
assert "When the report lands" not in out
|
|
assert "Read the report with `hermes curator status`" in out
|