test(integration): group /v1/messages contracts under tests/integration/messages

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
kerry 2026-09-26 21:59:47 +00:00
parent e47b1f2a3f
commit 9260932ddf
17 changed files with 5 additions and 2 deletions

View file

@ -28,6 +28,8 @@ Provider contracts exercise actual TCP requests with synthetic credentials and l
Streaming checks send real HTTP transfer chunks, including one-byte partitions, fragmented tools, incomplete transfers and a cancellation barrier. They assert meaningful text, tool arguments, final usage and persisted cost. The Redis recovery case owns a separate database and Redis process, uses the supported one-second circuit-breaker recovery setting, waits for the real subscriber and verifies response data in Redis after restart. CircleCI reuses its existing Redis image for that extra process; it never pulls an image during tests
The `messages/` directory holds `/v1/messages` endpoint contracts grouped by backend subfolder (`anthropic`, `bedrock`, `gemini`, `responses_bridge`, `chat_bridge`) and runs in the providers shard; `run.py` selects test files recursively under each scheduled directory
The sdk shard exercises the SDK's own HTTP clients against local protocol peers with no gateway in the path, so a case here fails only when the client library or its wire behavior changes. The HTTP/2 case runs a hypercorn TLS peer offering h2 and http/1.1 over ALPN, drives the sync and async httpx handlers at it with `LITELLM_HTTP2` off and on, and asserts the version both the client and the peer observed on the wire. Put a test here only when it needs no proxy, database or Redis; a case that reaches the gateway belongs in one of the other shards
The extensions shard uses the built-in generic callback and guardrail transports. It checks callback correlation and credential exclusion, guardrail rewriting and denial, retained OpenAI consumers and A2A wire versions

View file

@ -10,6 +10,7 @@ OWNED_DIRECTORIES: Final = frozenset(
"routing",
"providers",
"streaming",
"messages",
"configuration",
"mcp",
"observability",

View file

@ -14,7 +14,7 @@ GROUPS: Final = MappingProxyType(
"management": ("management", "authorization", "configuration"),
"accounting": ("pricing", "spend"),
"database": ("database",),
"providers": ("providers", "routing", "streaming"),
"providers": ("providers", "routing", "streaming", "messages"),
"extensions": ("observability", "compatibility"),
"mcp": ("mcp",),
"sdk": ("sdk",),
@ -35,7 +35,7 @@ def main() -> int:
selected: Final = tuple(
str(path.relative_to(root))
for folder in GROUPS[options.group]
for path in sorted((root / "tests/integration" / folder).glob("test_*.py"))
for path in sorted((root / "tests/integration" / folder).rglob("test_*.py"))
)
if not selected:
parser.error(f"No integration test files selected for {options.group}")