Skip to content

Fix/integration test fixes#357

Merged
dangusev merged 5 commits intomainfrom
fix/integration-test-fixes
Feb 13, 2026
Merged

Fix/integration test fixes#357
dangusev merged 5 commits intomainfrom
fix/integration-test-fixes

Conversation

@dangusev
Copy link
Contributor

@dangusev dangusev commented Feb 13, 2026

This PR fixes some integration tests, see commits for more details.

Summary by CodeRabbit

Release Notes

  • Documentation

    • Updated example code to use default LLM initialization patterns across multiple plugins (HeyGen, Inworld, Mistral, and others).
  • New Features

    • Participant objects now support an id field in addition to existing properties.
  • Tests

    • Refactored test suites to class-based structures for better organization.
    • Updated tests to include participant support in audio processing workflows.
  • Updates

    • Updated default LLM model from "gemini-2.5-flash" to "gemini-3-flash-preview" for GeminiFilesearchRAG.

@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

📝 Walkthrough

Walkthrough

A sweeping standardization refactors gemini.LLM() usage across examples and tests by removing explicit model parameters, adds id fields to Participant objects, updates test signatures to pass participant arguments to STT processing methods, refactors moondream test suites to class-based structures, and updates default model versions.

Changes

Cohort / File(s) Summary
LLM Initialization Standardization
DEVELOPMENT.md, agents-core/vision_agents/core/profiling/base.py, plugins/deepgram/example/deepgram_tts_example.py, plugins/fish/example/fish_example.py, plugins/heygen/example/avatar_example.py, plugins/heygen/vision_agents/plugins/heygen/heygen_avatar_publisher.py, plugins/inworld/README.md, plugins/inworld/example/inworld_tts_example.py, plugins/mistral/README.md, plugins/mistral/example/mistral_stt_example.py, plugins/gemini/tests/test_gemini_llm.py, plugins/gemini/tests/test_gemini_realtime.py, tests/test_function_calling.py
Removes explicit model parameters from gemini.LLM() constructor calls across documentation examples and test fixtures, replacing gemini.LLM("gemini-2.0-flash") and variants with default gemini.LLM() invocations.
Participant Object Enhancement
plugins/deepgram/tests/test_deepgram_stt.py, plugins/elevenlabs/tests/test_elevenlabs_stt.py, plugins/nvidia/tests/test_nvidia_vlm.py, plugins/vogent/tests/test_vogent.py
Adds id parameter to Participant object instantiation in test calls (e.g., Participant({}, user_id="...", id="...")), aligning participant data to include explicit identifier alongside user_id.
Test Method Signature Updates
plugins/fast_whisper/tests/test_fast_whisper_stt.py, plugins/fish/tests/test_fish_stt.py, plugins/wizper/tests/test_wizper_stt.py
Extends test method signatures with new participant fixture parameter and passes participant to STT processing calls via participant=participant keyword argument.
Test Structure Refactoring
plugins/moondream/tests/test_moondream.py, plugins/moondream/tests/test_moondream_local_vlm.py
Reorganizes flat test functions into class-based test structure with multiple async/sync test methods, adds new fixtures (sample_image, golf_image, sample_frame), and expands test coverage for annotation paths and detect_objects configurations.
Model Version Updates
plugins/gemini/vision_agents/plugins/gemini/file_search.py
Changes default model parameter from "gemini-2.5-flash" to "gemini-3-flash-preview" in GeminiFilesearchRAG.init.
Documentation and API Reference Updates
plugins/heygen/README.md
Adds explicit avatar publisher configuration in quick start example (avatar_id, quality settings), documents new publish_video_track() method in API reference, and adjusts spacing/formatting across code examples.
Minor Import/Configuration Updates
plugins/openrouter/tests/test_openrouter_llm.py
Reorders imports and updates Gemini model string from "google/gemini-2.0-flash-001" to "google/gemini-3-flash-preview" in model tests.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

The LLM strings dissolve to air,
Default models breathe where names once gleamed—
Participants bloom with twin-lit ids,
Tests rebuild as selves, structured and stark,
A thousand small erasures becoming one.

🚥 Pre-merge checks | ✅ 2 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 78.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Fix/integration test fixes' is vague and generic, using non-descriptive phrasing that doesn't clearly convey the actual scope of changes. Revise the title to be more specific about the main changes, such as 'Update LLM initialization to use default constructors' or 'Add participant parameter to STT tests' to better reflect the primary modifications.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/integration-test-fixes

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@plugins/moondream/tests/test_moondream_local_vlm.py`:
- Around line 64-67: The class decorator list on TestMoondreamLocalVLM includes
an unconditional `@pytest.mark.skip` which prevents any tests from running and
makes the `@pytest.mark.skipif`(HF_TOKEN) ineffective; remove the bare
`@pytest.mark.skip` decorator from the TestMoondreamLocalVLM class so the
conditional `@pytest.mark.skipif`(not os.getenv("HF_TOKEN"), reason=...) controls
skipping (or replace the unconditional skip with a skip(reason="...") if you
truly want a documented temporary disable).

In `@plugins/moondream/tests/test_moondream.py`:
- Around line 86-97: The tests are violating the "never mock in tests" guideline
by monkey-patching processor._run_detection_sync in tests like test_moondream.py
(affecting test_run_inference, test_process_and_add_frame, etc.); refactor tests
to avoid monkey-patching by either invoking the real detection path with
deterministic inputs (use a controlled/sample image so
processor._run_detection_sync runs normally) or refactor the processor to accept
an injectable detection dependency (e.g., a DetectionInterface passed to the
constructor) and update tests to construct a test-specific implementation
instead of replacing processor._run_detection_sync at runtime; ensure tests such
as test_run_inference and test_process_and_add_frame create the processor with
the injectable dependency or use known test images and remove any assignments to
processor._run_detection_sync.
- Around line 240-244: The test uses hasattr(processor, "_last_results") which
violates the guideline; replace the hasattr check with direct attribute access
on processor._last_results and assert its contents (e.g., assert
processor._last_results is not None and "detections" in processor._last_results)
so an AttributeError will surface if the attribute is missing and the test still
verifies "detections" exists; update the lines referencing hasattr to directly
access processor._last_results in the test before calling await
processor.close().
🧹 Nitpick comments (6)
plugins/deepgram/tests/test_deepgram_stt.py (1)

29-36: Consider extracting the duplicate Participant into a local variable.

Two identical Participant({}, user_id="hi", id="hi") constructions in the same test — a small thing, like two mirrors facing each other in an empty room. A local variable or the shared participant fixture from conftest.py would reduce duplication.

♻️ Suggested simplification
+        participant = Participant({}, user_id="hi", id="hi")
         # Process the mia audio
         await stt.process_audio(
-            mia_audio_48khz, participant=Participant({}, user_id="hi", id="hi")
+            mia_audio_48khz, participant=participant
         )
 
         # Send 2 seconds of silence to trigger end of turn
         await stt.process_audio(
-            silence_2s_48khz, participant=Participant({}, user_id="hi", id="hi")
+            silence_2s_48khz, participant=participant
         )
tests/test_function_calling.py (1)

5-12: The mocking in this file violates coding guidelines — but that's pre-existing, not introduced here.

The newly added OpenAILLM import and pytest reorder look fine. Just noting: the extensive Mock/@patch usage throughout this file conflicts with the project guideline "Never mock in tests." This predates the current PR, but it may be worth a follow-up cleanup. As per coding guidelines, **/*test*.py: "Never mock in tests; use pytest for testing."

plugins/moondream/tests/test_moondream_local_vlm.py (2)

68-86: Redundant warmup() call—the fixture already warms up the VLM.

The local_vlm_vqa fixture (line 43) already calls await vlm.warmup() before yielding. Calling it again on line 73 is unnecessary overhead (and the same pattern repeats in test_local_caption_mode on line 93).

Proposed fix
     async def test_local_vqa_mode(
         self, golf_frame: av.VideoFrame, local_vlm_vqa: LocalVLM
     ):
         """Test LocalVLM VQA mode with a question about the image."""
-
-        await local_vlm_vqa.warmup()
         assert local_vlm_vqa.model is not None, "Model must be loaded before test"

34-46: Async generator fixtures should use AsyncIterator in the return type hint, not a bare type.

These fixtures yield, making them generators, but the type hint says -> LocalVLM / -> LocalVLM. This won't cause runtime failures but misrepresents the fixture's nature to type checkers and readers.

Also applies to: 49-61

plugins/moondream/tests/test_moondream.py (2)

43-56: Image opened in _thread is never closed—potential resource leak.

Image.open(image_path) on line 49 is not wrapped in a with statement or explicitly closed. The image handle stays open until GC collects it. A with block would be safer.

Proposed fix
     def _thread():
         if image_path.exists():
-            image = Image.open(image_path)
-            frame_array = np.array(image)
-            return frame_array
+            with Image.open(image_path) as image:
+                frame_array = np.array(image)
+                return frame_array
         else:
             return None

332-334: print statements left in test methods—prefer logging or remove.

Multiple integration tests use print() for diagnostic output (lines 332–334, 360–363, 392–396). In a pytest-based suite, captured stdout is typically hidden unless the test fails. Consider using logging or pytest's caplog/capsys if the output is genuinely valuable, or removing it if it was debug scaffolding.

Also applies to: 360-363, 392-396

"nvidia/cosmos-reason2-8b" model doesn't seem to be available
for completions api
@dangusev dangusev merged commit 3245943 into main Feb 13, 2026
9 checks passed
@dangusev dangusev deleted the fix/integration-test-fixes branch February 13, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants