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

VertexAI: update testing to clone mock responses from shared repo #8333

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,6 @@ docs/
*.tfstate
*.tfstate.*

# generated test case text data
# vertexai test data
vertexai-sdk-test-data
mocks-lookup.ts
3 changes: 2 additions & 1 deletion packages/vertexai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"build": "rollup -c && yarn api-report",
"build:deps": "lerna run --scope @firebase/vertexai --include-dependencies build",
"dev": "rollup -c -w",
"testsetup": "yarn ts-node ./test-utils/convert-mocks.ts",
"update-responses": "cd test-utils && rm -rf vertexai-sdk-test-data && git clone --depth 1 https://github.com/FirebaseExtended/vertexai-sdk-test-data.git",
"testsetup": "yarn update-responses && yarn ts-node ./test-utils/convert-mocks.ts",
"test": "run-p --npm-path npm lint test:browser",
"test:ci": "yarn testsetup && node ../../scripts/run_tests_in_ci.js -s test",
"test:browser": "yarn testsetup && karma start --single-run",
Expand Down
5 changes: 4 additions & 1 deletion packages/vertexai/test-utils/convert-mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ const fs = require('fs');
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { join } = require('path');

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

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

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading