haystack icon indicating copy to clipboard operation
haystack copied to clipboard

Create a test suite for all integrations that inherit from `OpenAIChatGenerator`

Open mpangrazzi opened this issue 2 months ago • 1 comments

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:

  1. AIMLAPI - AIMLAPIChatGenerator
  2. CometAPI - CometAPIChatGenerator (to be merged)
  3. LlamaStack - LlamaStackChatGenerator
  4. Meta Llama - MetaLlamaChatGenerator
  5. Mistral - MistralChatGenerator
  6. NVIDIA - NvidiaChatGenerator
  7. OpenRouter - OpenRouterChatGenerator
  8. STACKIT - STACKITChatGenerator
  9. 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.

mpangrazzi avatar Oct 22 '25 08:10 mpangrazzi

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?

kudos07 avatar Oct 28 '25 06:10 kudos07