Skip to content

Commit

Permalink
VertexAI: update testing to clone mock responses from shared repo (#8333
Browse files Browse the repository at this point in the history
)
  • Loading branch information
tanzimfh authored Jun 27, 2024
1 parent e7260e2 commit 226fe8a
Show file tree
Hide file tree
Showing 24 changed files with 8 additions and 425 deletions.
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

0 comments on commit 226fe8a

Please sign in to comment.