Skip to content

Commit 25f2e25

Browse files
partners[patch]: Mongodb Retrievers - CI final touches. (langchain-ai#25202)
## Description Contains 2 updates to for integration tests to run on langchain's CI. Addendum to langchain-ai#25057 to get release github action to succeed.
1 parent 786ef02 commit 25f2e25

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

libs/partners/mongodb/tests/integration_tests/test_chain_example.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
CONNECTION_STRING = os.environ.get("MONGODB_ATLAS_URI")
2121
DB_NAME = "langchain_test_db"
2222
COLLECTION_NAME = "langchain_test_chain_example"
23-
INDEX_NAME = "vector_index_with_filter"
23+
INDEX_NAME = "vector_index"
2424
DIMENSIONS = 1536
2525
TIMEOUT = 60.0
2626
INTERVAL = 0.5

libs/partners/mongodb/tests/integration_tests/test_index.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
from langchain_mongodb import index
1111

12+
DB_NAME = "langchain_test_index_db"
13+
COLLECTION_NAME = "test_index"
14+
VECTOR_INDEX_NAME = "vector_index"
15+
1216
TIMEOUT = 120
1317
DIMENSIONS = 10
1418

@@ -18,14 +22,14 @@ def collection() -> Generator:
1822
"""Depending on uri, this could point to any type of cluster."""
1923
uri = os.environ.get("MONGODB_ATLAS_URI")
2024
client: MongoClient = MongoClient(uri)
21-
clxn = client["db"]["collection"]
25+
clxn = client[DB_NAME][COLLECTION_NAME]
2226
clxn.insert_one({"foo": "bar"})
2327
yield clxn
2428
clxn.drop()
2529

2630

2731
def test_search_index_commands(collection: Collection) -> None:
28-
index_name = "vector_index"
32+
index_name = VECTOR_INDEX_NAME
2933
dimensions = DIMENSIONS
3034
path = "embedding"
3135
similarity = "cosine"

libs/partners/mongodb/tests/integration_tests/test_retrievers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
CONNECTION_STRING = os.environ.get("MONGODB_ATLAS_URI")
2020
DB_NAME = "langchain_test_db"
21-
COLLECTION_NAME = "test_retrievers"
21+
COLLECTION_NAME = "langchain_test_retrievers"
2222
VECTOR_INDEX_NAME = "vector_index"
2323
EMBEDDING_FIELD = "embedding"
2424
PAGE_CONTENT_FIELD = "text"

0 commit comments

Comments
 (0)