Skip to content

Commit

Permalink
Version bump to 3.11.0 (#276)
Browse files Browse the repository at this point in the history
* skip client tests

* re-add client tests, fix marqo cloud URL

* delete marqo cloud url at test start

* add setUp and tearDown to tests

* version bump
  • Loading branch information
vicilliar authored Feb 12, 2025
1 parent 692ee88 commit d590620
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"tox"
],
name="marqo",
version="3.10.0",
version="3.11.0",
author="marqo org",
author_email="org@marqo.io",
description="Tensor search for humans",
Expand Down
19 changes: 15 additions & 4 deletions tests/v2_tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@

@mark.fixed
class TestClient(MarqoTestCase):
def setUp(self) -> None:
super().setUp()
self.initial_marqo_cloud_url = os.environ.get("MARQO_CLOUD_URL", constants.CLOUD_AWS_API_ENDPOINT)

def tearDown(self) -> None:
super().tearDown()
os.environ["MARQO_CLOUD_URL"] = self.initial_marqo_cloud_url

def test_check_index_health_response(self):
for cloud_test_index_to_use, open_source_test_index_name in self.test_cases:
test_index_name = self.get_test_index_name(
Expand All @@ -39,17 +47,16 @@ def test_check_index_health_query(self):
self.assertIn(f"health", kwargs["path"])

def test_overwrite_cloud_url_and_client_is_set_to_marqo(self):
current = os.environ.get("MARQO_CLOUD_URL", constants.CLOUD_AWS_API_ENDPOINT)
os.environ["MARQO_CLOUD_URL"] = "https://cloud.url.com"
client = Client(url="https://cloud.url.com", api_key="test")
self.assertTrue(client.config.is_marqo_cloud)
os.environ["MARQO_CLOUD_URL"] = current

def test_default_cloud_endpoint_client_is_marqo_cloud(self):
"""
Checks that if a client is created with one of the 2 cloud URLs (AWS or GCP),
Checks that if MARQO_CLOUD_URL is not set and a client is created with one of the 2 cloud URLs (AWS or GCP),
the client is set to Marqo Cloud.
"""
del os.environ["MARQO_CLOUD_URL"]
for cloud_url in constants.CLOUD_API_ENDPOINTS:
client = Client(url=cloud_url)
self.assertTrue(client.config.is_marqo_cloud)
Expand All @@ -58,8 +65,10 @@ def test_default_cloud_endpoint_client_is_marqo_cloud(self):

def test_non_cloud_endpoint_client_is_not_marqo_cloud(self):
"""
Checks that if a client is created with a non-cloud URL, the client is not set to Marqo Cloud.
Checks that if MARQO_CLOUD_URL is not set and a client is created with a non-cloud URL,
the client is not set to Marqo Cloud.
"""
del os.environ["MARQO_CLOUD_URL"]
client = Client(url="https://arandomsite.ai")
self.assertFalse(client.config.is_marqo_cloud)
self.assertIsInstance(client.config.instance_mapping, DefaultInstanceMappings)
Expand All @@ -69,9 +78,11 @@ def test_non_cloud_endpoint_client_is_not_marqo_cloud(self):
@mark.fixed
class TestClientMethods(MarqoTestCase):
def setUp(self) -> None:
super().setUp()
self.initial_marqo_cloud_url = os.environ.get("MARQO_CLOUD_URL", constants.CLOUD_AWS_API_ENDPOINT)

def tearDown(self) -> None:
super().tearDown()
os.environ["MARQO_CLOUD_URL"] = self.initial_marqo_cloud_url

def test_is_cloud_api_endpoint(self):
Expand Down

0 comments on commit d590620

Please sign in to comment.