Create a test suite for all integrations that inherit from `OpenAIChatGenerator`
Currently, we have 8 integrations (soon 9) that inherit from OpenAIChatGenerator on Haystack Core Integrations, each with nearly identical test files. So we have a lot of lines of duplicated test code.
Affected Integrations:
- AIMLAPI -
AIMLAPIChatGenerator - CometAPI -
CometAPIChatGenerator(to be merged) - LlamaStack -
LlamaStackChatGenerator - Meta Llama -
MetaLlamaChatGenerator - Mistral -
MistralChatGenerator - NVIDIA -
NvidiaChatGenerator - OpenRouter -
OpenRouterChatGenerator - STACKIT -
STACKITChatGenerator - Together AI -
TogetherAIChatGenerator
Each integration has nearly identical test files with only minor variations (model names, API keys, URLs).
With @sjrl we were discussing about creating an unified test suite which can reduce the code duplication between integrations.
Thanks for raising this. I can look into drafting a shared test suite so each integration just specifies model-specific params (name, API URL, key env var).
Would you prefer this as a base ChatGeneratorTestMixin or a pytest parametrized approach?