Skip to content

Commit bb10c26

Browse files
committed
Fix Vespa base integration test fixture
1 parent 9cc4fc5 commit bb10c26

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

integrations/vespa/tests/test_document_store.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,39 @@ class TestVespaDocumentStoreBase(
339339
Requires ``VESPA_RUN_INTEGRATION_TESTS=1`` and ``docker compose up`` (see project CI workflow).
340340
"""
341341

342+
@pytest.fixture
343+
def document_store(self, deployed_vespa_app, request): # noqa: ARG002
344+
"""Override the inherited base fixture with a Docker-backed Vespa store."""
345+
metadata_fields = [
346+
"category",
347+
"author",
348+
"name",
349+
"page",
350+
"chapter",
351+
"number",
352+
"date",
353+
"no_embedding",
354+
"year",
355+
"status",
356+
"updated",
357+
"extra_field",
358+
"featured",
359+
"priority",
360+
"rating",
361+
"age",
362+
]
363+
store = VespaDocumentStore(
364+
url="http://localhost",
365+
schema="doc",
366+
namespace="doc",
367+
content_field="content",
368+
embedding_field="embedding",
369+
metadata_fields=metadata_fields,
370+
)
371+
store.delete_all_documents()
372+
yield store
373+
store.delete_all_documents()
374+
342375
@pytest.fixture
343376
def filterable_docs(self) -> list[Document]:
344377
"""Vespa embeddings are restricted to tensor dimension 3 in ``vespa_app/schemas/doc.sd``."""

0 commit comments

Comments
 (0)