From f4057533aacf3da89de49553b85ed960fb38f1b1 Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Sun, 27 Sep 2026 13:50:10 +0530 Subject: [PATCH] test(cron): keep script-run tests off the host's PM store POSIX cron scripts now consult the managed store. Without isolation, a test run from a PM-managed checkout (the standard ~/.hermes/hermes-agent) reads the host's store and install records, trips the home I/O guard, and would run scripts on the host's dependency venv. Point HERMES_RUNTIME_DIR at an empty per-test dir for tests/cron. --- tests/cron/conftest.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/cron/conftest.py b/tests/cron/conftest.py index 256fff1403..b73ec99e93 100644 --- a/tests/cron/conftest.py +++ b/tests/cron/conftest.py @@ -45,6 +45,13 @@ def make_cron_provider(): return _make +@pytest.fixture(autouse=True) +def _no_managed_store(tmp_path, monkeypatch): + """Point PM's store at an empty dir: script runs must not select the host install's + dependency venv (POSIX cron scripts run on it when a store is committed).""" + monkeypatch.setenv("HERMES_RUNTIME_DIR", str(tmp_path / "no-pm-store")) + + @pytest.fixture(autouse=True) def _default_cron_test_model(monkeypatch): """Pin a default HERMES_MODEL so cron run_job tests have a resolvable model."""