feat: e2e suite + compatibility matrix (issue #60)#66
Open
feat: e2e suite + compatibility matrix (issue #60)#66
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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.tests/e2e/(10 tests) drivingcreateApp()withsupertestand mocking at the network boundary (globalThis.fetch):chat-completions.e2e.test.ts— non-stream + streaming SSE (assertsdata:framing + terminal[DONE])responses.e2e.test.ts—/v1/responsespassthrough (provider configured withprotocols: ["chat_completions","responses"])tools.e2e.test.ts— chat_completions tool calling round-trip (requesttools→ upstream →tool_callson response)anthropic-translation.e2e.test.ts— OpenAI→Anthropic translation + ephemeralcache_controlinjection on system + last-message blocksroute-resolve.e2e.test.ts—/v1/route/resolvereturns route shape, never invokesglobalThis.fetchhealth-readiness.e2e.test.ts—/health200,/ready200 with providers, 503 with no providerstestruns unit suite (excludestests/e2e/**), newtest:e2eruns only e2e, newtest:allruns both. CI runs them as two separate required steps.What's intentionally not yet covered
Per the matrix in
docs/compatibility.md:streamResponsesDownstream), unit-tested onlyglobalThis.fetchcovers both the openai-compatible and anthropic-sdk adapters since the SDK uses fetch under the hood.anthropic-sdk×responsesis marked intentionally unsupported (the adapter does not implementcallResponses/streamResponses).Test plan
npm run check— cleannpm test— 118 unit tests passnpm run test:e2e— 10 e2e tests passCloses #60
🤖 Generated with Claude Code