Skip to content

feat: e2e suite + compatibility matrix (issue #60)#66

Open
arniesaha wants to merge 2 commits intomasterfrom
feat/issue-60-e2e-compat-matrix
Open

feat: e2e suite + compatibility matrix (issue #60)#66
arniesaha wants to merge 2 commits intomasterfrom
feat/issue-60-e2e-compat-matrix

Conversation

@arniesaha
Copy link
Copy Markdown
Owner

Summary

  • Adds docs/compatibility.md — a (provider kind × protocol × feature) matrix that explicitly tags each cell as supported+tested / supported+untested / intentionally unsupported / known-gap, linked from README under a new "Compatibility" heading.
  • Adds 6 e2e files under tests/e2e/ (10 tests) driving createApp() with supertest and mocking at the network boundary (globalThis.fetch):
    • chat-completions.e2e.test.ts — non-stream + streaming SSE (asserts data: framing + terminal [DONE])
    • responses.e2e.test.ts/v1/responses passthrough (provider configured with protocols: ["chat_completions","responses"])
    • tools.e2e.test.ts — chat_completions tool calling round-trip (request tools → upstream → tool_calls on response)
    • anthropic-translation.e2e.test.ts — OpenAI→Anthropic translation + ephemeral cache_control injection on system + last-message blocks
    • route-resolve.e2e.test.ts/v1/route/resolve returns route shape, never invokes globalThis.fetch
    • health-readiness.e2e.test.ts/health 200, /ready 200 with providers, 503 with no providers
  • Splits npm scripts: test runs unit suite (excludes tests/e2e/**), new test:e2e runs only e2e, new test:all runs both. CI runs them as two separate required steps.

What's intentionally not yet covered

Per the matrix in docs/compatibility.md:

  • responses streaming SSE — supported in code (streamResponsesDownstream), unit-tested only
  • anthropic-sdk streaming SSE + tool calling round-trip — unit-tested only
  • cross-provider failover end-to-end — unit-tested only
  • A live integration suite hitting real LiteLLM/Anthropic stays out of scope (flaky, needs secrets); mocking at globalThis.fetch covers both the openai-compatible and anthropic-sdk adapters since the SDK uses fetch under the hood.

anthropic-sdk × responses is marked intentionally unsupported (the adapter does not implement callResponses/streamResponses).

Test plan

  • npm run check — clean
  • npm test — 118 unit tests pass
  • npm run test:e2e — 10 e2e tests pass
  • CI runs unit + e2e steps separately, both green

Closes #60

🤖 Generated with Claude Code

arniesaha and others added 2 commits May 6, 2026 15:24
Adds docs/compatibility.md as the source of truth for which (provider kind ×
protocol × feature) cells are exercised end-to-end vs only intended to work,
and adds tests/e2e/* (supertest against createApp() with mocked downstreams)
covering: chat_completions non-stream + streaming SSE, responses passthrough
non-stream, chat_completions tool calling round-trip, OpenAI→Anthropic
translation with cache_control injection, /v1/route/resolve (no-dispatch),
and /health + /ready (200 + 503).

Splits npm scripts into test (unit, excludes tests/e2e), test:e2e, and
test:all. CI runs both as separate steps. README links to the matrix.

Closes #60

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The earlier scripts let sh expand 'tests/e2e/**' into actual file paths
before vitest saw them, which (a) passed only the first path to --exclude
and (b) turned the rest into positional filters. The result: 'npm test'
silently ran only the e2e files and 'npm run test:e2e' found no files
on CI's shell where globstar wasn't enabled.

Quote the exclude pattern so the literal glob reaches vitest's minimatch,
and switch test:e2e to --dir tests/e2e for an unambiguous directory
restriction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: add downstream compatibility matrix and e2e protocol coverage

1 participant