Skip to content

Commit

Permalink
Parallelize IT
Browse files Browse the repository at this point in the history
  • Loading branch information
Weves committed Dec 1, 2024
1 parent f12eb4a commit 19faa80
Show file tree
Hide file tree
Showing 3 changed files with 569 additions and 0 deletions.
11 changes: 11 additions & 0 deletions backend/danswer/document_index/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from danswer.document_index.interfaces import DocumentIndex
from danswer.document_index.vespa.index import VespaIndex
from shared_configs.configs import MULTI_TENANT
from shared_configs.configs import VECTOR_DB_INDEX_NAME_PREFIX__INTEGRATION_TEST_ONLY


def get_default_document_index(
Expand All @@ -13,6 +14,16 @@ def get_default_document_index(
"""Primary index is the index that is used for querying/updating etc.
Secondary index is for when both the currently used index and the upcoming
index both need to be updated, updates are applied to both indices"""

# modify index names for integration tests so that we can run many tests
# using the same Vespa instance w/o having them collide
if VECTOR_DB_INDEX_NAME_PREFIX__INTEGRATION_TEST_ONLY:
primary_index_name = (
f"{VECTOR_DB_INDEX_NAME_PREFIX__INTEGRATION_TEST_ONLY}_{primary_index_name}"
)
if secondary_index_name:
secondary_index_name = f"{VECTOR_DB_INDEX_NAME_PREFIX__INTEGRATION_TEST_ONLY}_{secondary_index_name}"

# Currently only supporting Vespa
return VespaIndex(
index_name=primary_index_name,
Expand Down
7 changes: 7 additions & 0 deletions backend/shared_configs/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,10 @@ async def async_return_default_schema(*args: Any, **kwargs: Any) -> str:
index_name="danswer_chunk_intfloat_multilingual_e5_small",
),
]

"""
INTEGRATION TEST ONLY SETTINGS
"""
VECTOR_DB_INDEX_NAME_PREFIX__INTEGRATION_TEST_ONLY = os.getenv(
"VECTOR_DB_INDEX_NAME_PREFIX__INTEGRATION_TEST_ONLY"
)
Loading

0 comments on commit 19faa80

Please sign in to comment.