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
57 lines
2.3 KiB
Python
57 lines
2.3 KiB
Python
"""Fixtures shared across hermes_cli kanban tests."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture
|
|
def all_assignees_spawnable(monkeypatch):
|
|
"""Pretend every assignee maps to a real Hermes profile.
|
|
|
|
Most dispatcher tests use synthetic assignees ("alice", "bob") that
|
|
don't correspond to actual profile directories on disk. Without this
|
|
patch, the dispatcher's profile-exists guard (PR #20105) routes
|
|
those tasks into ``skipped_nonspawnable`` instead of spawning, which
|
|
would break tests that assert spawn behavior.
|
|
"""
|
|
from hermes_cli import profiles
|
|
monkeypatch.setattr(profiles, "profile_exists", lambda name: True)
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def _suppress_concurrent_hermes_gate(request, monkeypatch):
|
|
"""Default ``_detect_concurrent_hermes_instances`` to ``[]`` for every test.
|
|
|
|
The Windows update path now refuses to proceed when another
|
|
``hermes.exe`` is detected (issue #26670). On a developer's Windows
|
|
machine running the test suite via ``hermes`` itself, this would
|
|
flag the running agent as a concurrent instance and abort every
|
|
``cmd_update`` test. Tests that want to exercise the gate explicitly
|
|
re-patch ``_detect_concurrent_hermes_instances`` with their own
|
|
return value — autouse here gives a clean default without touching
|
|
the rest of the suite.
|
|
|
|
Tests that need to call the REAL function (e.g. unit tests for the
|
|
helper itself) opt out with ``@pytest.mark.real_concurrent_gate``.
|
|
"""
|
|
if request.node.get_closest_marker("real_concurrent_gate"):
|
|
return
|
|
try:
|
|
from hermes_cli import main as _cli_main
|
|
except Exception:
|
|
return
|
|
# raising=False: under pytest's per-test spawn isolation, a concurrent
|
|
# xdist worker importing a module that transitively touches hermes_cli.main
|
|
# can briefly expose a partially-initialized module object here — one where
|
|
# _detect_concurrent_hermes_instances isn't defined yet. A bare setattr
|
|
# would raise AttributeError and error the (unrelated) test. The attribute
|
|
# always exists once main.py finishes importing, so a no-op when it's
|
|
# transiently absent is the correct, race-free default.
|
|
monkeypatch.setattr(
|
|
_cli_main,
|
|
"_detect_concurrent_hermes_instances",
|
|
lambda *_a, **_k: [],
|
|
raising=False,
|
|
)
|