Skip to content

Commit

Permalink
tenants: Add test to validate shard creation
Browse files Browse the repository at this point in the history
Add test case to ensure a shard is created after the tenant
creation

Signed-off-by: Rodrigo Lopez <[email protected]>
  • Loading branch information
rlmanrique committed Dec 13, 2024
1 parent cb03b68 commit cf15efe
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions integration/test_tenants.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@
from weaviate.exceptions import WeaviateInvalidInputError, WeaviateUnsupportedFeatureError


def test_shards_on_tenants(client_factory: ClientFactory, collection_factory: CollectionFactory):
collection = collection_factory(
vectorizer_config=Configure.Vectorizer.none(),
multi_tenancy_config=Configure.multi_tenancy(enabled=True),
)
collection.tenants.create(Tenant(name="tenant1"))
client = client_factory()
count = sum(
len(node.shards) for node in client.cluster.nodes(collection.name, output="verbose")
)

assert count == 1


@pytest.mark.parametrize("tenant", ["tenant1", Tenant(name="tenant1")])
def test_delete_by_id_tenant(
collection_factory: CollectionFactory, tenant: Union[str, Tenant]
Expand Down

0 comments on commit cf15efe

Please sign in to comment.