Skip to content

Commit c821d62

Browse files
PYTHON-4522 Add LlamaIndex kvstore test (#32)
1 parent 7f4995b commit c821d62

File tree

6 files changed

+48
-4
lines changed

6 files changed

+48
-4
lines changed

.evergreen/config.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,31 @@ buildvariants:
164164
tasks:
165165
- name: test-chatgpt-retrieval-plugin
166166

167-
- name: test-llama-index-rhel
168-
display_name: LlamaIndex RHEL
167+
- name: test-llama-index-kvstore-rhel
168+
display_name: LlamaIndex RHEL KV Store
169169
expansions:
170-
DIR: llama-index
170+
DIR: llama-index-python-kvstore
171171
REPO_NAME: llama_index
172-
CLONE_URL: https://github.com/run-llama/llama_index.git
172+
# TODO - Update CLONE_URL: [PYTHON-4522]
173+
CLONE_URL: -b PYTHON-4522 --single-branch https://github.com/shruti-sridhar/llama_index.git
173174
DATABASE: llama_index_test_db
174175
run_on:
175176
- rhel87-small
176177
tasks:
177178
- name: test-llama-index
178179

180+
- name: test-llama-index-vectorstore-rhel
181+
display_name: LlamaIndex RHEL Vector Store
182+
expansions:
183+
DIR: llama-index-python-vectorstore
184+
REPO_NAME: llama_index
185+
CLONE_URL: https://github.com/run-llama/llama_index.git
186+
DATABASE: llama_index_test_db
187+
run_on:
188+
- rhel87-small
189+
tasks:
190+
- name: test-llama-index
191+
179192
- name: test-docarray-rhel
180193
display_name: DocArray RHEL
181194
expansions:

llama-index-python-kvstore/run.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
3+
set -x
4+
5+
. $workdir/src/.evergreen/utils.sh
6+
7+
CONN_STRING=$($atlas deployments connect $DIR --connectWith connectionString)
8+
PYTHON_BINARY=$(find_python3)
9+
$PYTHON_BINARY -c "import sys; print(f'Python version found: {sys.version_info}')"
10+
11+
# cd to the MongoDB integration. It has its own project
12+
cd llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-mongodb
13+
14+
# Install Poetry into base python
15+
$PYTHON_BINARY -m pip install -U pip poetry
16+
# Create a package specific poetry environment
17+
$PYTHON_BINARY -m poetry env use $PYTHON_BINARY
18+
# Activate the poetry env, which itself does not include poetry
19+
source $($PYTHON_BINARY -m poetry env info --path)/bin/activate
20+
# Recreate the poetry lock file
21+
$PYTHON_BINARY -m poetry lock --no-update
22+
# Install from pyproject.toml into package specific environment
23+
$PYTHON_BINARY -m poetry install --with dev
24+
25+
# Run tests. Sensitive variables in Evergreen come from Evergreen project: ai-ml-pipeline-testing/
26+
OPENAI_API_KEY=$openai_api_key \
27+
MONGODB_URI=$CONN_STRING \
28+
MONGODB_DATABASE="llama_index_test_db" \
29+
MONGODB_COLLECTION="llama_index_test_kvstore" \
30+
$PYTHON_BINARY -m poetry run pytest -v tests
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]
File renamed without changes.

0 commit comments

Comments
 (0)