Skip to content

Commit 7c8ea5e

Browse files
committed
VertexAI: update testing to clone mock responses from shared repo
1 parent 8360014 commit 7c8ea5e

23 files changed

+3
-424
lines changed

packages/vertexai/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
"build": "rollup -c && yarn api-report",
3434
"build:deps": "lerna run --scope @firebase/vertexai --include-dependencies build",
3535
"dev": "rollup -c -w",
36-
"testsetup": "yarn ts-node ./test-utils/convert-mocks.ts",
36+
"update-responses": "cd test-utils && rm -rf vertexai-sdk-test-data && git clone https://github.com/FirebaseExtended/vertexai-sdk-test-data.git",
37+
"testsetup": "yarn update-responses && yarn ts-node ./test-utils/convert-mocks.ts",
3738
"test": "run-p --npm-path npm lint test:browser",
3839
"test:ci": "yarn testsetup && node ../../scripts/run_tests_in_ci.js -s test",
3940
"test:browser": "yarn testsetup && karma start --single-run",

packages/vertexai/test-utils/convert-mocks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const fs = require('fs');
2525
// eslint-disable-next-line @typescript-eslint/no-require-imports
2626
const { join } = require('path');
2727

28-
const mockResponseDir = join(__dirname, 'mock-responses');
28+
const mockResponseDir = join(__dirname, 'vertexai-sdk-test-data/mock-responses');
2929

3030
async function main(): Promise<void> {
3131
const list = fs.readdirSync(mockResponseDir);

packages/vertexai/test-utils/mock-responses/streaming-failure-empty-content.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

packages/vertexai/test-utils/mock-responses/streaming-failure-finish-reason-safety.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

packages/vertexai/test-utils/mock-responses/streaming-failure-prompt-blocked-safety.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

packages/vertexai/test-utils/mock-responses/streaming-failure-recitation-no-content.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/vertexai/test-utils/mock-responses/streaming-success-basic-reply-long.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/vertexai/test-utils/mock-responses/streaming-success-basic-reply-short.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

packages/vertexai/test-utils/mock-responses/streaming-success-citations.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/vertexai/test-utils/mock-responses/streaming-success-function-call-short.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)