Skip to content

test(vertexai): add backendName param to mock response getters #8906

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

Merged
merged 3 commits into from
Apr 9, 2025

Conversation

dlarocque
Copy link
Contributor

backendName can be either googleAI or vertexAI. This can be passed to getMockResponse or getMockResponseStreaming to specify whether the mock response lookup should be done in the set of vertexAI or googleAI mock files.

Modified the convert-mocks.ts script to read mock responses from the 'developerapi' directory, and add an export to the generated file for the new lookup object with those mock responses.

`backendName` can be either `googleAI` or `vertexAI`. This can be passed
to `getMockResponse` or `getMockResponseStreaming` to specify whether
the mock response lookup should be done in the set of vertexAI or
googleAI mock files.

Modified the `convert-mocks.ts` script to read mock responses from the
'developerapi' directory, and add an export to the generated file for
the new lookup object with those mock responses.
@dlarocque dlarocque requested review from DellaBitta and hsubox76 April 8, 2025 18:29
@dlarocque dlarocque requested a review from a team as a code owner April 8, 2025 18:29
Copy link

changeset-bot bot commented Apr 8, 2025

⚠️ No Changeset found

Latest commit: cea47ec

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 8, 2025

Size Report 1

Affected Products

  • @firebase/firestore

    TypeBase (66a09f2)Merge (cf17af7)Diff
    browser382 kB382 kB+32 B (+0.0%)
    module382 kB382 kB+32 B (+0.0%)
    react-native382 kB382 kB+32 B (+0.0%)
  • bundle

    TypeBase (66a09f2)Merge (cf17af7)Diff
    firestore (CSI Auto Indexing Disable and Delete)272 kB272 kB+32 B (+0.0%)
    firestore (CSI Auto Indexing Enable)272 kB272 kB+32 B (+0.0%)
    firestore (Persistence)304 kB304 kB+32 B (+0.0%)
    firestore (Query Cursors)250 kB250 kB+32 B (+0.0%)
    firestore (Query)248 kB248 kB+32 B (+0.0%)
    firestore (Read data once)236 kB236 kB+32 B (+0.0%)
    firestore (Read Write w Persistence)328 kB328 kB+32 B (+0.0%)
    firestore (Realtime updates)238 kB238 kB+32 B (+0.0%)
    firestore (Transaction)215 kB215 kB+32 B (+0.0%)
    firestore (Write data)214 kB214 kB+32 B (+0.0%)
  • firebase

    TypeBase (66a09f2)Merge (cf17af7)Diff
    firebase-compat.js794 kB794 kB+32 B (+0.0%)
    firebase-firestore-compat.js340 kB340 kB+32 B (+0.0%)
    firebase-firestore.js440 kB440 kB+32 B (+0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/okWLF5yMNv.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 8, 2025

Size Analysis Report 1

Affected Products

  • @firebase/firestore

    • addDoc

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size133 kB133 kB+32 B (+0.0%)
      size-with-ext-deps205 kB205 kB+32 B (+0.0%)
    • deleteDoc

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size123 kB123 kB+32 B (+0.0%)
      size-with-ext-deps195 kB195 kB+32 B (+0.0%)
    • disableNetwork

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size112 kB112 kB+32 B (+0.0%)
      size-with-ext-deps184 kB184 kB+32 B (+0.0%)
    • enableIndexedDbPersistence

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size187 kB187 kB+32 B (+0.0%)
      size-with-ext-deps259 kB259 kB+32 B (+0.0%)
    • enableMultiTabIndexedDbPersistence

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size223 kB223 kB+32 B (+0.0%)
      size-with-ext-deps295 kB295 kB+32 B (+0.0%)
    • enableNetwork

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size112 kB112 kB+32 B (+0.0%)
      size-with-ext-deps184 kB184 kB+32 B (+0.0%)
    • executeWrite

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size123 kB123 kB+32 B (+0.0%)
      size-with-ext-deps195 kB195 kB+32 B (+0.0%)
    • getAggregateFromServer

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size120 kB120 kB+32 B (+0.0%)
      size-with-ext-deps192 kB192 kB+32 B (+0.0%)
    • getCountFromServer

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size120 kB120 kB+32 B (+0.0%)
      size-with-ext-deps192 kB192 kB+32 B (+0.0%)
    • getDoc

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size154 kB154 kB+32 B (+0.0%)
      size-with-ext-deps226 kB226 kB+32 B (+0.0%)
    • getDocFromServer

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size154 kB154 kB+32 B (+0.0%)
      size-with-ext-deps226 kB226 kB+32 B (+0.0%)
    • getDocs

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size156 kB156 kB+32 B (+0.0%)
      size-with-ext-deps228 kB228 kB+32 B (+0.0%)
    • getDocsFromServer

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size156 kB156 kB+32 B (+0.0%)
      size-with-ext-deps228 kB228 kB+32 B (+0.0%)
    • loadBundle

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size121 kB121 kB+32 B (+0.0%)
      size-with-ext-deps193 kB193 kB+32 B (+0.0%)
    • memoryLocalCache

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size106 kB106 kB+32 B (+0.0%)
      size-with-ext-deps178 kB178 kB+32 B (+0.0%)
    • onSnapshot

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size156 kB156 kB+32 B (+0.0%)
      size-with-ext-deps228 kB228 kB+32 B (+0.0%)
    • onSnapshotsInSync

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size145 kB145 kB+32 B (+0.0%)
      size-with-ext-deps217 kB217 kB+32 B (+0.0%)
    • persistentLocalCache

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size183 kB183 kB+32 B (+0.0%)
      size-with-ext-deps255 kB255 kB+32 B (+0.0%)
    • persistentMultipleTabManager

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size219 kB219 kB+32 B (+0.0%)
      size-with-ext-deps291 kB291 kB+32 B (+0.0%)
    • persistentSingleTabManager

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size183 kB183 kB+32 B (+0.0%)
      size-with-ext-deps255 kB255 kB+32 B (+0.0%)
    • runTransaction

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size133 kB133 kB+32 B (+0.0%)
      size-with-ext-deps205 kB205 kB+32 B (+0.0%)
    • setDoc

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size132 kB132 kB+32 B (+0.0%)
      size-with-ext-deps204 kB204 kB+32 B (+0.0%)
    • updateDoc

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size133 kB133 kB+32 B (+0.0%)
      size-with-ext-deps205 kB205 kB+32 B (+0.0%)
    • waitForPendingWrites

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size112 kB112 kB+32 B (+0.0%)
      size-with-ext-deps184 kB184 kB+32 B (+0.0%)
    • writeBatch

      Size

      TypeBase (66a09f2)Merge (cf17af7)Diff
      size135 kB135 kB+32 B (+0.0%)
      size-with-ext-deps207 kB207 kB+32 B (+0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/fdrAG8vwBP.html

@dlarocque dlarocque merged commit 4e0f630 into main Apr 9, 2025
35 of 37 checks passed
@dlarocque dlarocque deleted the dl/mock-resp-googleai branch April 9, 2025 18:19
hsubox76 pushed a commit that referenced this pull request Apr 14, 2025
`backendName` can be either `googleAI` or `vertexAI`. This can be passed
to `getMockResponse` or `getMockResponseStreaming` to specify whether
the mock response lookup should be done in the set of vertexAI or
googleAI mock files.

Modified the `convert-mocks.ts` script to read mock responses from the
'developerapi' directory, and add an export to the generated file for
the new lookup object with those mock responses.
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.

3 participants