Skip to content

The agent engineering platform.

partners[patch]: Mongodb Retrievers - CI final touches. (#25202)

Casey Clements25f2e25be12c
diff --git a/libs/partners/mongodb/tests/integration_tests/test_chain_example.py b/libs/partners/mongodb/tests/integration_tests/test_chain_example.py
index c5c33c537d..861a398cc8 100644
--- a/libs/partners/mongodb/tests/integration_tests/test_chain_example.py
+++ b/libs/partners/mongodb/tests/integration_tests/test_chain_example.py
@@ -20,7 +20,7 @@ from ..utils import PatchedMongoDBAtlasVectorSearch
CONNECTION_STRING = os.environ.get("MONGODB_ATLAS_URI")
DB_NAME = "langchain_test_db"
COLLECTION_NAME = "langchain_test_chain_example"
-INDEX_NAME = "vector_index_with_filter"
+INDEX_NAME = "vector_index"
DIMENSIONS = 1536
TIMEOUT = 60.0
INTERVAL = 0.5
diff --git a/libs/partners/mongodb/tests/integration_tests/test_index.py b/libs/partners/mongodb/tests/integration_tests/test_index.py
index bc06fd4e3e..000cbed484 100644
--- a/libs/partners/mongodb/tests/integration_tests/test_index.py
+++ b/libs/partners/mongodb/tests/integration_tests/test_index.py
@@ -9,6 +9,10 @@ from pymongo.collection import Collection
from langchain_mongodb import index
+DB_NAME = "langchain_test_index_db"
+COLLECTION_NAME = "test_index"
+VECTOR_INDEX_NAME = "vector_index"
+
TIMEOUT = 120
DIMENSIONS = 10
@@ -18,14 +22,14 @@ def collection() -> Generator:
"""Depending on uri, this could point to any type of cluster."""
uri = os.environ.get("MONGODB_ATLAS_URI")
client: MongoClient = MongoClient(uri)
- clxn = client["db"]["collection"]
+ clxn = client[DB_NAME][COLLECTION_NAME]
clxn.insert_one({"foo": "bar"})
yield clxn
clxn.drop()
def test_search_index_commands(collection: Collection) -> None:
- index_name = "vector_index"
+ index_name = VECTOR_INDEX_NAME
dimensions = DIMENSIONS
path = "embedding"
similarity = "cosine"
diff --git a/libs/partners/mongodb/tests/integration_tests/test_retrievers.py b/libs/partners/mongodb/tests/integration_tests/test_retrievers.py
index 8723396f97..8a0cf34c85 100644
--- a/libs/partners/mongodb/tests/integration_tests/test_retrievers.py
+++ b/libs/partners/mongodb/tests/integration_tests/test_retrievers.py
@@ -18,7 +18,7 @@ from ..utils import ConsistentFakeEmbeddings, PatchedMongoDBAtlasVectorSearch
CONNECTION_STRING = os.environ.get("MONGODB_ATLAS_URI")
DB_NAME = "langchain_test_db"
-COLLECTION_NAME = "test_retrievers"
+COLLECTION_NAME = "langchain_test_retrievers"
VECTOR_INDEX_NAME = "vector_index"
EMBEDDING_FIELD = "embedding"
PAGE_CONTENT_FIELD = "text"