Skip to content

Commit

Permalink
Skip pinecone test if pinecone is not installed (#1192)
Browse files Browse the repository at this point in the history
The integration test currently fails if pinecone is not installed. Added
a skip marker for the same.
  • Loading branch information
Chitti-Ankith authored Sep 22, 2023
1 parent 097cec0 commit 4654c0e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions evadb/utils/generic_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,14 @@ def is_qdrant_available() -> bool:
return False


def is_pinecone_available() -> bool:
try:
try_to_import_pinecone_client()
return True
except ValueError: # noqa: E722
return False


##############################
## UTILS
##############################
Expand Down
3 changes: 2 additions & 1 deletion test/integration_tests/long/test_similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import os
import time
import unittest
from test.markers import qdrant_skip_marker
from test.markers import pinecone_skip_marker, qdrant_skip_marker
from test.util import (
create_sample_image,
get_evadb_for_testing,
Expand Down Expand Up @@ -411,6 +411,7 @@ def test_end_to_end_index_scan_should_work_correctly_on_image_dataset_qdrant(sel
# Cleanup
self.evadb.catalog().drop_index_catalog_entry("testQdrantIndexImageDataset")

@pinecone_skip_marker
def test_end_to_end_index_scan_should_work_correctly_on_image_dataset_pinecone(
self,
):
Expand Down
6 changes: 6 additions & 0 deletions test/markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
is_forecast_available,
is_gpu_available,
is_ludwig_available,
is_pinecone_available,
is_qdrant_available,
)

Expand All @@ -34,6 +35,11 @@
reason="qdrant requires grcpio which is broken on 3.11",
)

pinecone_skip_marker = pytest.mark.skipif(
is_pinecone_available() is False,
reason="skipping since pinecone is not installed",
)

windows_skip_marker = pytest.mark.skipif(
sys.platform == "win32", reason="Test case not supported on Windows"
)
Expand Down

0 comments on commit 4654c0e

Please # to comment.