Skip to content

test(e2e): add Gemini TTS coverage to provider matrix#751

Open
harshlocham wants to merge 1 commit into
TanStack:mainfrom
harshlocham:test/gemini-tts-e2e
Open

test(e2e): add Gemini TTS coverage to provider matrix#751
harshlocham wants to merge 1 commit into
TanStack:mainfrom
harshlocham:test/gemini-tts-e2e

Conversation

@harshlocham

@harshlocham harshlocham commented Jun 12, 2026

Copy link
Copy Markdown

🎯 Changes

Gemini TTS is already implemented and covered by unit tests, but it was not participating in the E2E TTS provider matrix because the provider-specific E2E wiring was incomplete.

This PR adds Gemini TTS to the existing E2E infrastructure by:

  • Adding a Gemini TTS adapter factory in media-providers.ts
  • Adding a Gemini generateContent audio mock in global-setup.ts
  • Adding gemini to the TTS provider support matrix
  • Exercising the adapter's PCM-to-WAV normalization path using raw PCM audio responses (audio/L16;codec=pcm;rate=24000)

No runtime behavior, public APIs, or package functionality are changed. This PR only extends test coverage for an existing feature.

Verification

  • Gemini TTS E2E tests pass (SSE, HTTP stream, and fetcher modes)
  • Full TTS provider matrix passes
  • No changes outside test infrastructure

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Tests
    • Expanded end-to-end test coverage to include Gemini Text-to-Speech provider with audio format validation.
    • Updated test provider support matrix to include Gemini TTS testing capabilities.
    • Implemented Gemini TTS adapter integration for test infrastructure.

Wire Gemini TTS into the existing E2E test infrastructure.

- Add Gemini TTS adapter factory in media-providers
- Add Gemini generateContent audio mock
- Add Gemini to TTS feature support
- Exercise PCM-to-WAV normalization using raw PCM audio responses

This extends existing TTS E2E coverage without changing
runtime behavior or public APIs.
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9ac1a081-6bcb-48a3-81d2-e8e8f44d1b4e

📥 Commits

Reviewing files that changed from the base of the PR and between 984ac3c and 7171f79.

📒 Files selected for processing (3)
  • testing/e2e/global-setup.ts
  • testing/e2e/src/lib/feature-support.ts
  • testing/e2e/src/lib/media-providers.ts

📝 Walkthrough

Walkthrough

This PR adds end-to-end test support for Gemini TTS by declaring the provider in the feature matrix, wiring the TTS adapter factory with test configuration, and implementing a mock Gemini generateContent endpoint that returns PCM-encoded audio to exercise the adapter's normalization path.

Changes

Gemini TTS End-to-End Testing

Layer / File(s) Summary
Feature support matrix
testing/e2e/src/lib/feature-support.ts
Declares gemini as a supported TTS provider in the e2e test matrix alongside openai, grok, and elevenlabs.
Gemini TTS adapter factory
testing/e2e/src/lib/media-providers.ts
Reformats Gemini imports and adds a gemini entry to the createTTSAdapter factory map configured with test base URL and headers.
Gemini TTS mock endpoint and registration
testing/e2e/global-setup.ts
Adds FAKE_PCM_BYTES test data, implements geminiTTSMount() to return Gemini-shaped JSON with base64-encoded PCM audio, and mounts it in globalSetup.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🐰 A Gemini speaks now, in audio so clear,
With PCM bytes and a mock setup dear!
The TTS path flows, from test to the sound,
E2E magic—more providers found! 🎵

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding Gemini TTS coverage to the E2E provider matrix, which aligns with the changeset modifications.
Description check ✅ Passed The description covers all required template sections with substantive content: changes are explained, checklist items are marked, and release impact is properly documented as dev-only.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant