Skip to content

Commit c274376

Browse files
committed
finish local testing
1 parent f5c14d2 commit c274376

File tree

16 files changed

+96
-43
lines changed

16 files changed

+96
-43
lines changed

.evergreen/.local_atlas_uri

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONN_STRING=mongodb://127.0.0.1:39239/?directConnection=true

.evergreen/config.yml

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -37,33 +37,21 @@ functions:
3737
args: [.evergreen/fetch-secrets.sh]
3838

3939
"fetch repo":
40-
- command: shell.exec
40+
- command: subprocess.exec
4141
type: setup
4242
params:
4343
working_dir: "src"
44-
script: |
45-
if [ ! -d "${DIR}" ]; then
46-
echo '${REPO_NAME} could not be found' 1>&2
47-
exit 1
48-
fi
49-
# Apply patches to upstream repo if desired.
50-
cd ${DIR}
51-
git clone ${CLONE_URL}
52-
if [ -d "patches" ]; then
53-
cd ${REPO_NAME}
54-
echo "Applying patches."
55-
git apply ../patches/*
56-
fi
44+
binary: bash
45+
args: [.evergreen/fetch-repo.sh]
5746

5847
"execute tests":
5948
- command: subprocess.exec
6049
type: test
6150
params:
6251
add_expansions_to_env: true
63-
working_dir: "src/${DIR}/${REPO_NAME}"
52+
working_dir: "src"
6453
binary: bash
65-
args:
66-
- ../run.sh
54+
args: [.evergreen/execute-tests.sh]
6755

6856
"setup local atlas":
6957
- command: subprocess.exec
@@ -194,10 +182,6 @@ buildvariants:
194182
display_name: LlamaIndex RHEL KV Store
195183
expansions:
196184
DIR: llama-index-python-kvstore
197-
REPO_NAME: llama_index
198-
# TODO - Update CLONE_URL: [PYTHON-4522] [INTPYTHON-326]
199-
CLONE_URL: -b PYTHON-4522 --single-branch https://github.com/shruti-sridhar/llama_index.git
200-
DATABASE: llama_index_test_db
201185
run_on:
202186
- rhel87-small
203187
tasks:
@@ -209,9 +193,6 @@ buildvariants:
209193
display_name: Semantic-Kernel RHEL Python
210194
expansions:
211195
DIR: semantic-kernel-python
212-
REPO_NAME: semantic-kernel
213-
CLONE_URL: https://github.com/microsoft/semantic-kernel.git
214-
DATABASE: pyMSKTest
215196
run_on:
216197
- rhel87-small
217198
tasks:
@@ -224,9 +205,6 @@ buildvariants:
224205
display_name: Semantic-Kernel RHEL CSharp
225206
expansions:
226207
DIR: semantic-kernel-csharp
227-
REPO_NAME: semantic-kernel
228-
CLONE_URL: https://github.com/microsoft/semantic-kernel.git
229-
DATABASE: dotnetMSKNearestTest
230208
run_on:
231209
- rhel87-small
232210
tasks:
@@ -238,9 +216,6 @@ buildvariants:
238216
display_name: Langchain RHEL Python
239217
expansions:
240218
DIR: langchain-python
241-
REPO_NAME: langchain-mongodb
242-
CLONE_URL: https://github.com/langchain-ai/langchain-mongodb.git
243-
DATABASE: langchain_test_db
244219
run_on:
245220
- rhel87-small
246221
tasks:
@@ -252,9 +227,6 @@ buildvariants:
252227
display_name: Langgraph RHEL Python
253228
expansions:
254229
DIR: langgraph-python
255-
REPO_NAME: langchain-mongodb
256-
CLONE_URL: https://github.com/langchain-ai/langchain-mongodb.git
257-
DATABASE: langgraph-test
258230
run_on:
259231
- rhel87-small
260232
tasks:
@@ -266,9 +238,6 @@ buildvariants:
266238
display_name: ChatGPT Retrieval Plugin
267239
expansions:
268240
DIR: chatgpt-retrieval-plugin
269-
REPO_NAME: chatgpt-retrieval-plugin
270-
CLONE_URL: https://github.com/openai/chatgpt-retrieval-plugin.git
271-
DATABASE: chatgpt_retrieval_plugin_test_db
272241
run_on:
273242
- rhel87-small
274243
tasks:
@@ -280,9 +249,6 @@ buildvariants:
280249
display_name: LlamaIndex RHEL Vector Store
281250
expansions:
282251
DIR: llama-index-python-vectorstore
283-
REPO_NAME: llama_index
284-
CLONE_URL: https://github.com/run-llama/llama_index.git
285-
DATABASE: llama_index_test_db
286252
run_on:
287253
- rhel87-small
288254
tasks:
@@ -295,9 +261,6 @@ buildvariants:
295261
display_name: DocArray RHEL
296262
expansions:
297263
DIR: docarray
298-
REPO_NAME: docarray
299-
CLONE_URL: https://github.com/docarray/docarray.git
300-
DATABASE: docarray_test_db
301264
run_on:
302265
- rhel87-small
303266
tasks:

.evergreen/execute-tests.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
5+
SCRIPT_DIR=$(realpath $(dirname ${BASH_SOURCE[0]}))
6+
ROOT_DIR=$(dirname $SCRIPT_DIR)
7+
8+
9+
# Source the configuration.
10+
cd ${ROOT_DIR}/${DIR}
11+
set -a
12+
source config.env
13+
set +a
14+
15+
cd ${REPO_NAME}
16+
bash ${ROOT_DIR}/${DIR}/run.sh

.evergreen/fetch-repo.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
5+
if [ ! -d "${DIR}" ]; then
6+
echo '${REPO_NAME} could not be found' 1>&2
7+
exit 1
8+
fi
9+
10+
cd ${DIR}
11+
12+
# Source the configuration.
13+
set -a
14+
source config.env
15+
set +a
16+
17+
rm -rf ${REPO_NAME}
18+
git clone ${CLONE_URL}
19+
20+
# Apply patches to upstream repo if desired.
21+
if [ -d "patches" ]; then
22+
cd ${REPO_NAME}
23+
echo "Applying patches."
24+
git apply ../patches/*
25+
fi

.evergreen/fetch-secrets.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -eu
44

55
# Clone drivers-evergeen-tools.
6-
git clone https://github.com/mongodb-labs/drivers-evergreen-tools
6+
git clone https://github.com/mongodb-labs/drivers-evergreen-tools || true
77

88
# Get the secrets for drivers/ai-ml-pipeline-testing.
99
. drivers-evergreen-tools/.evergreen/secrets_handling/setup-secrets.sh drivers/ai-ml-pipeline-testing

.evergreen/provision-atlas.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ set -eu
33

44
. .evergreen/utils.sh
55

6+
# Source the config
7+
pushd $DIR
8+
set -a
9+
. config.env
10+
set +x
11+
popd
12+
613
setup_local_atlas
714
scaffold_atlas
815

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ xunit-results/
5050
# Miscellaneous
5151
.DS_Store
5252
drivers-evergreen-tools
53+
atlas
5354

5455
# Secrets
5556
secrets-export.sh

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,21 @@ CONN_STRING=$(fetch_local_atlas_uri)
6161

6262
Stores the local Atlas URI within the `CONN_STRING` var. The script can then pass `CONN_STRING` as an environment variable to the test suite.
6363

64+
#### Running tests locally.
65+
66+
We can run the tests with a local checkout of the repo.
67+
68+
For example, to run the `docarray` tests using local atlas:
69+
70+
```bash
71+
export DIR=docarray
72+
bash .evergreen/fetch-repo.sh
73+
bash .evergreen/provision-atlas.sh
74+
bash .evergreen/execute-tests.sh
75+
```
76+
77+
Use `.evergreen/setup-remote.sh` instead of `.evergreen/provision-atlas.sh` to test against the remote cluster.
78+
6479
#### Pre-populating the Local Atlas Deployment
6580

6681
You can pre-populate a test's local Atlas deployment before running the `run.sh` script by providing JSON files in the optional `database` directory of the created subdirectory. The `.evergreen/scaffold_atlas.py` file will search for every JSON file within this database directory and upload the documents to the database provided by the `DATABASE` expansion provided in the build variant of the `.evergreen/config.yml` setup. The collection the script uploads to is based on the name of your JSON file:

chatgpt-retrieval-plugin/config.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
REPO_NAME=chatgpt-retrieval-plugin
2+
CLONE_URL="https://github.com/openai/chatgpt-retrieval-plugin.git"
3+
DATABASE=chatgpt_retrieval_plugin_test_db

docarray/config.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
REPO_NAME=docarray
2+
CLONE_URL="https://github.com/docarray/docarray.git"
3+
DATABASE=docarray_test_db

0 commit comments

Comments
 (0)