Quality Gates

This commit is contained in:
Renn F
2026-05-05 03:19:43 +02:00
parent 4829f93a68
commit 85ef124c8f
23 changed files with 2459 additions and 456 deletions
+46 -2
View File
@@ -14,7 +14,6 @@ dependencies = [
"pydantic",
"pydantic-settings",
# API
"aiofiles",
"fastapi",
"uvicorn[standard]",
"websockets",
@@ -213,6 +212,50 @@ testpaths = ["tests"]
python_files = ["test_*.py"]
asyncio_default_fixture_loop_scope = "function"
addopts = "--cov=roboco --cov-report=term-missing"
[tool.coverage.run]
# Modules excluded from the coverage gate because they require live
# infrastructure (Ollama, real audio/video stacks, real workspaces,
# Docker daemon, Claude Code CLI) that the unit-coverage gate does not
# provision. They're covered by dedicated integration runs (smoke tests
# on the NAS) rather than the unit-coverage threshold.
omit = [
# RAG / proactive context — needs Ollama + real embedding model.
"roboco/services/proactive.py",
"roboco/services/optimal.py",
"roboco/services/optimal_brain/*",
# Audio transcription — needs Whisper-class model.
"roboco/services/transcription.py",
# Agent classes — instantiated by the orchestrator when spawning
# Docker containers running the Claude CLI. No usable unit-test
# surface; integration coverage is the smoke run.
"roboco/agents/*",
"roboco/agent_sdk/*",
# Container orchestration — drives Docker daemon, agent spawning,
# health/dispatch loops. Covered by smoke runs.
"roboco/runtime/orchestrator.py",
# MCP server entry points — modeled around the Claude CLI's STDIO
# MCP transport and only meaningful when running inside an agent
# container with the orchestrator reachable. Their _post() bridges
# ARE unit-tested separately (test_envelope_on_4xx, test_flow_server,
# test_do_server) — just not via direct module import here.
"roboco/mcp/*",
# WebSocket route — needs a running ASGI app + WS client.
"roboco/api/websocket.py",
# Event stream bus — wraps Redis Streams; tested via integration only.
"roboco/events/stream_bus.py",
# GitService — runs `git` subprocesses against per-agent workspaces.
# Unit-testable surface is < 5% of the module; covered via the
# _StubGit-based real-DB integration test + live smoke runs.
"roboco/services/git.py",
"roboco/services/workspace.py",
# Notification delivery — Redis Streams + push to MCP transport.
"roboco/services/notification_delivery.py",
# CLI entry point.
"roboco/cli.py",
# Auto-generated migrations.
"alembic/*",
]
markers = [
"asyncio: mark tests as async",
"slow: marks tests as slow",
@@ -329,6 +372,8 @@ DEP002 = [
"radon",
"xenon",
"deptry",
# CLI tool — invoked as `lint-imports` from the Makefile / quality gate
"import-linter",
"ipython",
"rich",
# Type stubs (used by mypy)
@@ -348,7 +393,6 @@ dev = [
"pytest>=9.0.3",
"pytest-asyncio>=1.3.0",
"pytest-cov>=7.1.0",
"types-aiofiles",
]
# =============================================================================