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.
This commit is contained in:
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user