feat: chat params e2e - #1591
Conversation
WalkthroughAdds a new end-to-end test file to validate chat completion parameter handling across multiple models. Tests are generated from parameter/value matrices, gated by RUN_PARAM_TESTS, send POST /v1/chat/completions requests, assert 200 responses, validate payloads and logs, and include a basic placeholder test. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Pull request overview
This PR adds a new end-to-end test suite for chat completion parameters. The test file validates that various API parameters (temperature, max_tokens, top_p, frequency_penalty, presence_penalty, and combinations thereof) work correctly across all configured models.
Changes:
- Added comprehensive e2e test suite for chat API parameters with 6 different parameter configurations
- Tests are gated behind
RUN_PARAM_TESTSenvironment variable to allow selective execution - Tests verify both successful responses and proper logging for all parameter combinations
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } from "@/chat-helpers.e2e.js"; | ||
|
|
||
| // Use all testModels - filter via TEST_MODELS env var for specific providers | ||
| const paramTestModels = testModels; |
There was a problem hiding this comment.
The variable paramTestModels is assigned the value of testModels but serves no purpose other than aliasing. It would be clearer to use testModels directly throughout the file, including in the console.log statement on line 21 and in the flatMap on line 40. This reduces unnecessary indirection and makes the code more maintainable.
Summary by CodeRabbit