Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Address TODO to migrate to VCRpy and remove bespoke RequestMocker code in Google GenAI SDK instrumentation #3344

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

michaelsafyan
Copy link
Contributor

@michaelsafyan michaelsafyan commented Mar 6, 2025

Description

Revises the tests to split up into two different categories:

  1. A majority of tests that fully mock out the GenAI SDK (and do not need any request-level mocking).
  2. An end-to-end ("e2e") test that uses VCRpy to test with a non-mocked GenAI SDK to sanity-check the system.

This addresses prior pull request feedback expressing concern regarding bespoke request mocking and deviation from typical pattern elsewhere of using the VCRpy component. This also addresses the original underlying concerns regarding velocity; since most tests do not use VCRpy and directly mock the underlying GenAI SDK, most feature changes can be tested with much simpler mocks of the GenAI SDK outputs.

Type of change

  • Code cleanup

How Has This Been Tested?

  • Recorded with:

  • tox -e py312-test-instrumentation-google-genai-oldest --vcr-record=all

  • Ran the tests with:

  • tox -e py312-test-instrumentation-google-genai-oldest

Does This PR Require a Core Repo Change?

  • No

@michaelsafyan michaelsafyan marked this pull request as ready for review March 7, 2025 22:26
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.

8 participants