Skip to content

Commit 8aef9b0

Browse files
Commit all changes with precommit
1 parent 3f05afa commit 8aef9b0

File tree

5 files changed

+110
-0
lines changed

5 files changed

+110
-0
lines changed

.evergreen/config.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,25 @@ tasks:
244244
- func: "fetch repo"
245245
- func: "execute tests"
246246

247+
- name: test-langchain-js-local
248+
tags: [local]
249+
commands:
250+
- func: "fetch repo"
251+
- func: "execute tests"
252+
- command: attach.xunit_results
253+
params:
254+
file: src/langchain-js/langchainjs/libs/langchain-mongodb/results.xml
255+
256+
- name: test-langchain-js-remote
257+
tags: [remote]
258+
commands:
259+
- func: "fetch repo"
260+
- func: "setup remote atlas"
261+
- func: "execute tests"
262+
- command: attach.xunit_results
263+
params:
264+
file: src/langchain-js/langchainjs/libs/langchain-mongodb/results.xml
265+
247266
buildvariants:
248267
- name: test-semantic-kernel-python-rhel
249268
display_name: Semantic-Kernel RHEL Python
@@ -363,3 +382,13 @@ buildvariants:
363382
- ubuntu2204-small
364383
tasks:
365384
- name: test-langchaingo-local
385+
386+
- name: test-langchain-js-ubuntu
387+
display_name: LangchainJS Ubuntu2204
388+
expansions:
389+
DIR: langchain-js
390+
run_on:
391+
- ubuntu2204-small
392+
tasks:
393+
- name: test-langchain-js-local
394+
- name: test-langchain-js-remote

.evergreen/setup-remote.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ case $DIR in
4141
pymongo-voyageai)
4242
MONGODB_URI=$VOYAGEAI_MONGODB_URI
4343
;;
44+
langchain-js)
45+
MONGODB_URI=$LANGCHAIN_MONGODB_URI
46+
;;
4447
*)
4548
echo "Missing config in setup-remote.sh for DIR: $DIR"
4649
exit 1

langchain-js/config.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
REPO_NAME=langchainjs
2+
CLONE_URL="https://github.com/baileympearson/langchainjs.git"
3+
DATABASE=langchain_test_db
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "default",
3+
"type": "search",
4+
"mappings": {
5+
"fields": {
6+
"e": {
7+
"type": "number"
8+
},
9+
"embedding": {
10+
"dimensions": 1536,
11+
"similarity": "euclidean",
12+
"type": "knnVector"
13+
}
14+
}
15+
},
16+
"database": "langchain",
17+
"collectionName": "test"
18+
}

langchain-js/run.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
3+
set -o errexit
4+
5+
# TODO: remove before merging
6+
git branch
7+
git switch use-local-atlas
8+
git log -n 1
9+
10+
setup_remote_atlas() {
11+
# Get the MONGODB_URI and OPENAI_API_KEY.
12+
SCRIPT_DIR=$(realpath "$(dirname ${BASH_SOURCE[0]})")
13+
ROOT_DIR=$(dirname $SCRIPT_DIR)
14+
15+
if [[ -f "$ROOT_DIR/env.sh" ]]; then
16+
echo "Sourcing $ROOT_DIR/env.sh"
17+
source $ROOT_DIR/env.sh
18+
fi
19+
20+
bash ../../.evergreen/fetch-secrets.sh
21+
source secrets-export.sh
22+
23+
if [[ -n "$MONGODB_URI" ]]; then
24+
export MONGODB_ATLAS_URI=$MONGODB_URI
25+
fi
26+
27+
echo "MONGODB_ATLAS_URI: $MONGODB_ATLAS_URI"
28+
}
29+
30+
setup_node_and_yarn() {
31+
# setup node, npm and yarn
32+
PATH=/opt/devtools/node22/bin:$(pwd)/bin:$PATH
33+
npm_config_prefix=$(pwd)
34+
export PATH
35+
export npm_config_prefix
36+
37+
npm install --global yarn
38+
}
39+
40+
setup_langchain_integration() {
41+
cd libs/langchain-mongodb
42+
43+
yarn install
44+
yarn build
45+
46+
yarn add --dev jest-junit
47+
export JEST_JUNIT_OUTPUT_NAME=results.xml
48+
49+
# optionally enable to debug local atlas in CI.
50+
# export DEBUG=testcontainers*
51+
}
52+
53+
setup_remote_atlas
54+
setup_node_and_yarn
55+
setup_langchain_integration
56+
57+
yarn test:int --reporters=default --reporters=jest-junit

0 commit comments

Comments
 (0)