Skip to content

Commit ef9b85c

Browse files
authored
google-vertexai[minor] Add standard tests (#5721)
* google-vertexai[minor] Add standard tests * moved tests to vertex * fixed tests * fixed latest/lowest ci * chore: lint files * chore: lint files
1 parent 3bc9b8e commit ef9b85c

File tree

18 files changed

+244
-822
lines changed

18 files changed

+244
-822
lines changed

.github/workflows/compatibility.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ jobs:
152152
- name: Test `@langchain/anthropic` with lowest deps
153153
run: docker compose -f dependency_range_tests/docker-compose.yml run anthropic-lowest-deps
154154

155-
# VertexAI
156-
vertexai-latest-deps:
155+
# Google VertexAI
156+
google-vertexai-latest-deps:
157157
runs-on: ubuntu-latest
158158
steps:
159159
- uses: actions/checkout@v4
@@ -162,10 +162,14 @@ jobs:
162162
with:
163163
node-version: ${{ env.NODE_VERSION }}
164164
cache: "yarn"
165+
- name: Install dependencies
166+
run: yarn install --immutable
167+
- name: Build `@langchain/standard-tests`
168+
run: yarn build --filter=@langchain/standard-tests
165169
- name: Test `@langchain/google-vertexai` with latest deps
166-
run: docker compose -f dependency_range_tests/docker-compose.yml run vertexai-latest-deps
170+
run: docker compose -f dependency_range_tests/docker-compose.yml run google-vertexai-latest-deps
167171

168-
vertexai-lowest-deps:
172+
google-vertexai-lowest-deps:
169173
runs-on: ubuntu-latest
170174
steps:
171175
- uses: actions/checkout@v4
@@ -174,5 +178,9 @@ jobs:
174178
with:
175179
node-version: ${{ env.NODE_VERSION }}
176180
cache: "yarn"
181+
- name: Install dependencies
182+
run: yarn install --immutable
183+
- name: Build `@langchain/standard-tests`
184+
run: yarn build --filter=@langchain/standard-tests
177185
- name: Test `@langchain/google-vertexai` with lowest deps
178-
run: docker compose -f dependency_range_tests/docker-compose.yml run vertexai-lowest-deps
186+
run: docker compose -f dependency_range_tests/docker-compose.yml run google-vertexai-lowest-deps

dependency_range_tests/docker-compose.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,25 +114,32 @@ services:
114114
- ./scripts:/scripts
115115
command: bash /scripts/with_standard_tests/anthropic/test-with-lowest-deps.sh
116116

117-
# VertexAI
118-
vertexai-latest-deps:
117+
# Google VertexAI
118+
google-vertexai-latest-deps:
119119
image: node:18
120120
environment:
121121
PUPPETEER_SKIP_DOWNLOAD: "true"
122122
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "true"
123+
COHERE_API_KEY: ${COHERE_API_KEY}
123124
working_dir: /app
124125
volumes:
126+
- ../turbo.json:/turbo.json
127+
- ../package.json:/package.json
128+
- ../libs/langchain-standard-tests:/libs/langchain-standard-tests
125129
- ../libs/langchain-google-vertexai:/libs/langchain-google-vertexai
126130
- ./scripts:/scripts
127-
command: bash /scripts/vertexai/test-with-latest-deps.sh
128-
vertexai-lowest-deps:
131+
command: bash /scripts/with_standard_tests/google-vertexai/test-with-latest-deps.sh
132+
google-vertexai-lowest-deps:
129133
image: node:18
130134
environment:
131135
PUPPETEER_SKIP_DOWNLOAD: "true"
132136
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "true"
137+
COHERE_API_KEY: ${COHERE_API_KEY}
133138
working_dir: /app
134139
volumes:
140+
- ../turbo.json:/turbo.json
141+
- ../package.json:/package.json
142+
- ../libs/langchain-standard-tests:/libs/langchain-standard-tests
135143
- ../libs/langchain-google-vertexai:/libs/langchain-google-vertexai
136144
- ./scripts:/scripts
137-
command: bash /scripts/vertexai/test-with-lowest-deps.sh
138-
145+
command: bash /scripts/with_standard_tests/google-vertexai/test-with-lowest-deps.sh

dependency_range_tests/scripts/vertexai/test-with-latest-deps.sh

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

dependency_range_tests/scripts/vertexai/test-with-lowest-deps.sh

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

dependency_range_tests/scripts/vertexai/node/update_resolutions_lowest.js renamed to dependency_range_tests/scripts/with_standard_tests/google-vertexai/node/update_resolutions_lowest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const fs = require("fs");
22
const semver = require("semver");
33

4-
const communityPackageJsonPath = "package.json";
4+
const communityPackageJsonPath = "/app/monorepo/libs/langchain-google-vertexai/package.json";
55

66
const currentPackageJson = JSON.parse(fs.readFileSync(communityPackageJsonPath));
77

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
set -euxo pipefail
4+
5+
export CI=true
6+
7+
# New monorepo directory paths
8+
monorepo_dir="/app/monorepo"
9+
monorepo_openai_dir="/app/monorepo/libs/langchain-google-vertexai"
10+
11+
# Run the shared script to copy all necessary folders/files
12+
bash /scripts/with_standard_tests/shared.sh google-vertexai
13+
14+
# Navigate back to monorepo root and install dependencies
15+
cd "$monorepo_dir"
16+
yarn
17+
18+
# Navigate into `@langchain/google-vertexai` to build and run tests
19+
# We need to run inside the google-vertexai directory so turbo repo does
20+
# not try to build the package/its workspace dependencies.
21+
cd "$monorepo_openai_dir"
22+
yarn test
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
3+
set -euxo pipefail
4+
5+
export CI=true
6+
7+
monorepo_dir="/app/monorepo"
8+
monorepo_openai_dir="/app/monorepo/libs/langchain-google-vertexai"
9+
updater_script_dir="/app/updater_script"
10+
updater_script_dir="/app/updater_script"
11+
original_updater_script_dir="/scripts/with_standard_tests/google-vertexai/node"
12+
13+
# Run the shared script to copy all necessary folders/files
14+
bash /scripts/with_standard_tests/shared.sh google-vertexai
15+
16+
# Copy the updater script to the monorepo
17+
mkdir -p "$updater_script_dir"
18+
cp "$original_updater_script_dir"/* "$updater_script_dir/"
19+
20+
# Install deps (e.g semver) for the updater script
21+
cd "$updater_script_dir"
22+
yarn
23+
# Run the updater script
24+
node "update_resolutions_lowest.js"
25+
26+
27+
# Navigate back to monorepo root and install dependencies
28+
cd "$monorepo_dir"
29+
yarn
30+
31+
# Navigate into `@langchain/package` to build and run tests
32+
# We need to run inside the package directory so turbo repo does
33+
# not try to build the package/its workspace dependencies.
34+
cd "$monorepo_openai_dir"
35+
yarn test

libs/langchain-google-gauth/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
"devDependencies": {
4343
"@jest/globals": "^29.5.0",
4444
"@langchain/scripts": "~0.0.14",
45-
"@langchain/standard-tests": "0.0.0",
4645
"@swc/core": "^1.3.90",
4746
"@swc/jest": "^0.2.29",
4847
"@tsconfig/recommended": "^1.0.3",

0 commit comments

Comments
 (0)