mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-01 12:02:05 +00:00
fix(ci): rip out some xdist legacy stuff... how did these ever work??
This commit is contained in:
parent
2fa66950e8
commit
bcc3eb3419
12 changed files with 8 additions and 38 deletions
|
|
@ -410,8 +410,8 @@ class TestSendUpdate:
|
|||
|
||||
assert created["coro"] is not None
|
||||
assert created["coro"].cr_frame is None
|
||||
# Only count warnings about THIS test's coroutine; other tests in the
|
||||
# same xdist worker (or stdlib mock internals) may emit unrelated
|
||||
# Only count warnings about THIS test's coroutine; other tests
|
||||
# may emit unrelated
|
||||
# "coroutine was never awaited" warnings that bleed through.
|
||||
runtime_warnings = [
|
||||
w for w in caught
|
||||
|
|
|
|||
|
|
@ -20,8 +20,7 @@ def _no_unawaited_warnings(caught, *, coro_name: str = "") -> bool:
|
|||
"""Return True if no "X was never awaited" warning slipped through.
|
||||
|
||||
When *coro_name* is provided, only warnings naming that coroutine are
|
||||
counted — xdist workers may emit unrelated unawaited-coroutine warnings
|
||||
(e.g. ``AsyncMockMixin._execute_mock_call``) from concurrent tests.
|
||||
counted
|
||||
"""
|
||||
bad = [
|
||||
w for w in caught
|
||||
|
|
|
|||
|
|
@ -39,10 +39,9 @@ def _write_skill(skills_dir: Path, name: str, description: str = "") -> Path:
|
|||
def hermes_home(monkeypatch):
|
||||
"""Isolate HERMES_HOME for ``reload_skills`` tests.
|
||||
|
||||
Rather than popping cache-bearing modules from ``sys.modules`` (which
|
||||
races against pytest-xdist's parallel workers), we monkeypatch the
|
||||
module-level ``HERMES_HOME`` / ``SKILLS_DIR`` constants in place so the
|
||||
isolation is local to this fixture's scope.
|
||||
Rather than popping cache-bearing modules from ``sys.modules``,
|
||||
we monkeypatch the module-level ``HERMES_HOME`` / ``SKILLS_DIR``
|
||||
constants in place so the isolation is local to this fixture's scope.
|
||||
"""
|
||||
td = tempfile.mkdtemp(prefix="hermes-reload-skills-")
|
||||
monkeypatch.setenv("HERMES_HOME", td)
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ from hermes_cli import main as hermes_main
|
|||
# ---------------------------------------------------------------------------
|
||||
# Module isolation: _import_cli() wipes tools.* / cli / run_agent from
|
||||
# sys.modules so it can re-import cli fresh. Without cleanup the wiped
|
||||
# modules leak into subsequent tests on the same xdist worker, breaking
|
||||
# modules leak into subsequent tests, breaking
|
||||
# mock patches that target "tools.file_tools._get_file_ops" etc.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -184,8 +184,7 @@ class TestGatewayQuickCommands:
|
|||
from gateway.run import GatewayRunner
|
||||
|
||||
# Ensure redaction is active regardless of host HERMES_REDACT_SECRETS state
|
||||
# or test ordering (the module snapshots env at import time, so other
|
||||
# tests in the same xdist worker can flip the flag).
|
||||
# or test ordering
|
||||
monkeypatch.setattr("agent.redact._REDACT_ENABLED", True)
|
||||
|
||||
runner = GatewayRunner.__new__(GatewayRunner)
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ import pytest
|
|||
# against each other (and against any other file that also touches
|
||||
# ``app.state``) — the marker name is shared across all dashboard-auth test
|
||||
# files that gate the app.
|
||||
pytestmark = pytest.mark.xdist_group("dashboard_auth_app_state")
|
||||
from fastapi import FastAPI
|
||||
from fastapi.responses import Response
|
||||
from fastapi.testclient import TestClient
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import pytest
|
|||
# against each other (and against any other file that also touches
|
||||
# ``app.state``) — the marker name is shared across all dashboard-auth test
|
||||
# files that gate the app.
|
||||
pytestmark = pytest.mark.xdist_group("dashboard_auth_app_state")
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from hermes_cli import web_server
|
||||
|
|
|
|||
|
|
@ -16,12 +16,6 @@ from __future__ import annotations
|
|||
|
||||
import pytest
|
||||
|
||||
# Phase 5 / Phase 6: these tests mutate ``web_server.app.state.auth_required``
|
||||
# at module level. Run them in the same xdist worker so they don't race
|
||||
# against each other (and against any other file that also touches
|
||||
# ``app.state``) — the marker name is shared across all dashboard-auth test
|
||||
# files that gate the app.
|
||||
pytestmark = pytest.mark.xdist_group("dashboard_auth_app_state")
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from hermes_cli import web_server
|
||||
|
|
|
|||
|
|
@ -16,11 +16,6 @@ import time
|
|||
|
||||
import pytest
|
||||
|
||||
# These tests mutate ``web_server.app.state.auth_required`` at module level,
|
||||
# so they share the dashboard-auth app-state xdist group to avoid racing
|
||||
# other gate tests.
|
||||
pytestmark = pytest.mark.xdist_group("dashboard_auth_app_state")
|
||||
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from hermes_cli import web_server
|
||||
|
|
|
|||
|
|
@ -32,10 +32,6 @@ from __future__ import annotations
|
|||
|
||||
import pytest
|
||||
|
||||
# Same xdist group as the other dashboard-auth tests — they all mutate
|
||||
# web_server.app.state.auth_required at module level.
|
||||
pytestmark = pytest.mark.xdist_group("dashboard_auth_app_state")
|
||||
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from hermes_cli import web_server
|
||||
|
|
|
|||
|
|
@ -20,10 +20,6 @@ from hermes_cli import web_server
|
|||
from hermes_cli.dashboard_auth import clear_providers, register_provider
|
||||
from tests.hermes_cli.conftest_dashboard_auth import StubAuthProvider
|
||||
|
||||
# These tests mutate ``web_server.app.state.auth_required`` so they share
|
||||
# the same xdist group as the other dashboard-auth gated_app tests.
|
||||
pytestmark = pytest.mark.xdist_group("dashboard_auth_app_state")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def gated_client():
|
||||
|
|
|
|||
|
|
@ -17,12 +17,6 @@ from types import SimpleNamespace
|
|||
|
||||
import pytest
|
||||
|
||||
# Phase 5 / Phase 6: these tests mutate ``web_server.app.state.auth_required``
|
||||
# at module level. Run them in the same xdist worker so they don't race
|
||||
# against each other (and against any other file that also touches
|
||||
# ``app.state``) — the marker name is shared across all dashboard-auth test
|
||||
# files that gate the app.
|
||||
pytestmark = pytest.mark.xdist_group("dashboard_auth_app_state")
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from hermes_cli import web_server
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue