test(providers): share the OpenAI-compatible contract across thin provider tests - #983
test(providers): share the OpenAI-compatible contract across thin provider tests#983SantiagoDePolonia wants to merge 2 commits into
Conversation
|
Warning Review limit reachedNext included review available in 11 minutes. View limit detailsLimit details: You’ve used all 4 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (54)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| t.Fatal("adaptChatRequest() copied a request it didn't need to change") | ||
| } | ||
| require.NoError(t, err) | ||
| assert.Equal(t, req, adapted) |
There was a problem hiding this comment.
This no-op test uses structural equality, so it also passes when the adapter allocates and returns an identical copy of the request. The implementation returns the original request when no legacy reasoning content needs adaptation; use require.Same(t, req, adapted) (or assert.Same) so an unnecessary-copy regression is caught. This is a non-blocking test-coverage concern, but retaining the pointer assertion avoids silently changing the no-op contract.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Artifacts
- The exact temporary in-package Go test was saved before removal; it checks the real no-op pointer plus the deep-equality-versus-identity distinction, proving the required assertion semantics.
- The original focused vLLM test command completed successfully with exit code 0, showing the current structural assertion passes but not establishing pointer identity.
- The authored focused Go test completed successfully with exit code 0, proving the current no-op implementation returns the original request pointer and that the stronger assertion is executable.
- Captured numbered source evidence shows the deep-equality assertion, the implementation’s conditional copy and `return req`, and that DeepSeek and MiniMax tests are included in this commit’s changed diff, confirming the candidate.
|
The vllm no-op adaptation checks now use |
Rewrites the tests of the thin provider adapters (every
internal/providers/<name>package except anthropic, gemini, and openai) on top ofprovidertestand testify.TestChatCompatibleContractviaprovidertest.AssertChatCompatible, which covers registration metadata, constructor safety, chat, streaming, model listing, Responses translation, and embeddings. The per-package copies of those tests are removed; provider-specific tests (headers, reasoning mapping, model ID rewriting, audio, images, realtime, error mapping) stay./responses(oracle, sglang, vllm, llamacpp, llmd, openrouter, xai) and the azure and bedrockmantle adapters keep their own tests and are noted in the report.var _declarations. Duplicate cases merged into tables (ollama, googlecommon, chatgpt, vllm, deepseek).Test-only change, about 5,600 net lines removed. Stacked on #976 (helper packages).