test: sweep every tool through the MCP server against a seeded Gitea

This commit is contained in:
Latte committed 2026-10-14 17:57:54 +02:00
1 parent 22c8157ca4
commit 303bd9aa21
7 files changed
+1759 -1

No files matched your search

+12 -1
View File
@@ -29,6 +29,7 @@ from tests.integration.harness import (
stop_gitea,
unique,
)
from tests.integration.sweep_plan import LOG, write_report_if_enabled
_HERE = Path(__file__).parent.resolve()
ENABLE_ENV = "AEGIS_INTEGRATION"
@@ -70,6 +71,14 @@ def pytest_collection_modifyitems(config: pytest.Config, items: list[pytest.Item
namespace.cov_fail_under = 0
def pytest_sessionfinish(session: pytest.Session, exitstatus: int) -> None:
"""Write ``docs/integration-coverage.md`` when ``AEGIS_IT_WRITE_REPORT=1`` and the sweep ran."""
from aegis_gitea_mcp.catalog import load_catalog
catalog = load_catalog()
write_report_if_enabled(catalog, catalog.spec_version)
@pytest.fixture(scope="session")
def gitea() -> Iterator[GiteaInstance]:
"""A throwaway Gitea in Docker, shared by the whole session."""
@@ -171,7 +180,9 @@ class McpSession:
self.texts.append(text)
payload = json.loads(text)
assert isinstance(payload, dict)
return ToolResult(tool=tool, is_error=bool(raw.is_error), payload=payload, text=text)
result = ToolResult(tool=tool, is_error=bool(raw.is_error), payload=payload, text=text)
LOG.add(tool, result.status, result.is_error)
return result
async def ok(
self, tool: str, /, *, status: int | tuple[int, ...] = (200, 201, 204), **arguments: Any