Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: update test cases and sdk version[2.4] #39433

Merged
merged 1 commit into from
Feb 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: update test cases and sdk version[2.4]
Signed-off-by: nico <cheng.yuan@zilliz.com>
NicoYuan1986 committed Jan 23, 2025
commit 49b69e7c7843dd3fd9f8845fea607dc67125b9c6
4 changes: 2 additions & 2 deletions tests/python_client/conftest.py
Original file line number Diff line number Diff line change
@@ -333,7 +333,7 @@ def check_server_connection(request):
# yield


@pytest.fixture(scope="module")
# @pytest.fixture(scope="module")
def connect(request):
host = request.config.getoption("--host")
service_name = request.config.getoption("--service")
@@ -360,7 +360,7 @@ def fin():
return milvus


@pytest.fixture(scope="module")
# @pytest.fixture(scope="module")
def dis_connect(request):
host = request.config.getoption("--host")
service_name = request.config.getoption("--service")
Original file line number Diff line number Diff line change
@@ -552,9 +552,10 @@ def test_milvus_client_release_partition_name_lists_not_all_exists(self):
client_w.create_collection(client, collection_name, default_dim)
error = {ct.err_code: 1, ct.err_msg: f"partition not found[partition={not_exist_partition}]"}
client_w.release_partitions(client, collection_name, partition_names,
check_task=CheckTasks.err_res, check_items=error)
check_task=CheckTasks.err_res, check_items=error)

@pytest.mark.tags(CaseLabel.L2)
@pytest.mark.skip("https://github.com/milvus-io/milvus/issues/38223")
def test_milvus_client_release_not_exist_partition_name(self):
"""
target: test fast release partition -- invalid partition name type
@@ -714,7 +715,7 @@ def test_milvus_client_list_partitions_invalid_collection_name(self, collection_
error = {ct.err_code: 1100, ct.err_msg: f"Invalid collection name: {collection_name}. the first character of a "
f"collection name must be an underscore or letter: invalid parameter"}
client_w.list_partitions(client, collection_name,
check_task=CheckTasks.err_res, check_items=error)
check_task=CheckTasks.err_res, check_items=error)

@pytest.mark.tags(CaseLabel.L1)
def test_milvus_client_list_partitions_collection_name_over_max_length(self):
@@ -729,7 +730,7 @@ def test_milvus_client_list_partitions_collection_name_over_max_length(self):
error = {ct.err_code: 1100, ct.err_msg: f"Invalid collection name: {collection_name}. the length of a collection name "
f"must be less than 255 characters: invalid parameter"}
client_w.list_partitions(client, collection_name,
check_task=CheckTasks.err_res, check_items=error)
check_task=CheckTasks.err_res, check_items=error)

@pytest.mark.tags(CaseLabel.L1)
def test_milvus_client_list_partitions_not_exist_collection_name(self):
4 changes: 2 additions & 2 deletions tests/python_client/requirements.txt
Original file line number Diff line number Diff line change
@@ -13,8 +13,8 @@ allure-pytest==2.7.0
pytest-print==0.2.1
pytest-level==0.1.1
pytest-xdist==2.5.0
pymilvus==2.4.13rc2
pymilvus[bulk_writer]==2.4.13rc2
pymilvus==2.4.14
pymilvus[bulk_writer]==2.4.14
pytest-rerunfailures==9.1.1
git+https://github.com/Projectplace/pytest-tags
ndg-httpsclient
Original file line number Diff line number Diff line change
@@ -217,14 +217,15 @@ async def test_async_client_partition(self):
@pytest.mark.tags(CaseLabel.L0)
async def test_async_client_with_schema(self, schema):
# init client
pk_field_name = "id"
milvus_client = self._connect(enable_milvus_client_api=True)
self.init_async_milvus_client()

# create collection
c_name = cf.gen_unique_str(prefix)
schema = self.async_milvus_client_wrap.create_schema(auto_id=False,
partition_key_field=ct.default_int64_field_name)
schema.add_field(ct.default_string_field_name, DataType.VARCHAR, max_length=100, is_primary=True)
schema.add_field(pk_field_name, DataType.VARCHAR, max_length=100, is_primary=True)
schema.add_field(ct.default_int64_field_name, DataType.INT64, is_partition_key=True)
schema.add_field(ct.default_float_vec_field_name, DataType.FLOAT_VECTOR, dim=ct.default_dim)
schema.add_field(default_vector_name, DataType.FLOAT_VECTOR, dim=ct.default_dim)
@@ -234,7 +235,7 @@ async def test_async_client_with_schema(self, schema):

# insert entities
rows = [
{ct.default_string_field_name: str(i),
{pk_field_name: str(i),
ct.default_int64_field_name: i,
ct.default_float_vec_field_name: [random.random() for _ in range(ct.default_dim)],
default_vector_name: [random.random() for _ in range(ct.default_dim)],
@@ -314,7 +315,7 @@ async def test_async_client_with_schema(self, schema):

# get with ids
get_task = self.async_milvus_client_wrap.get(c_name, ids=['0', '1'], output_fields=[ct.default_int64_field_name,
ct.default_string_field_name])
pk_field_name])
tasks.append(get_task)
await asyncio.gather(*tasks)

2 changes: 1 addition & 1 deletion tests/python_client/testcases/test_index.py
Original file line number Diff line number Diff line change
@@ -1193,7 +1193,7 @@ def invalid_index_name(self, request):
yield request.param

@pytest.mark.tags(CaseLabel.L0)
def test_index_with_invalid_index_name(self, connect, invalid_index_name):
def test_index_with_invalid_index_name(self, invalid_index_name):
"""
target: test create index interface for invalid scenario
method:
2 changes: 2 additions & 0 deletions tests/python_client/testcases/test_insert.py
Original file line number Diff line number Diff line change
@@ -2073,6 +2073,8 @@ def test_upsert_partition_name_non_existing(self, partition_name):
cf.insert_data(collection_w)
data = cf.gen_default_dataframe_data(nb=100)
error = {ct.err_code: 999, ct.err_msg: "Invalid partition name"}
if partition_name == "n-ame":
error = {ct.err_code: 999, ct.err_msg: f"partition not found[partition={partition_name}]"}
collection_w.upsert(data=data, partition_name=partition_name,
check_task=CheckTasks.err_res, check_items=error)

2 changes: 2 additions & 0 deletions tests/python_client/testcases/test_partition.py
Original file line number Diff line number Diff line change
@@ -208,6 +208,8 @@ def test_partition_invalid_name(self, partition_name):
"""
if partition_name == "12name":
pytest.skip(reason="won't fix issue #32998")
if partition_name == "n-ame":
pytest.skip(reason="https://github.com/milvus-io/milvus/issues/39432")
# create collection
collection_w = self.init_collection_wrap()

4 changes: 4 additions & 0 deletions tests/python_client/testcases/test_utility.py
Original file line number Diff line number Diff line change
@@ -144,6 +144,8 @@ def test_has_partition_name_value_invalid(self, get_invalid_value_collection_nam
p_name = get_invalid_value_collection_name
if p_name == "12name":
pytest.skip("partition name 12name is legal")
if p_name == "n-ame":
pytest.skip("https://github.com/milvus-io/milvus/issues/39432")
error = {ct.err_code: 999, ct.err_msg: f"Invalid partition name: {p_name}"}
if p_name in [None]:
error = {ct.err_code: 999, ct.err_msg: f"`partition_name` value {p_name} is illegal"}
@@ -287,6 +289,8 @@ def test_loading_progress_invalid_partition_names(self, partition_name):
method: input invalid partition names
expected: raise an exception
"""
if partition_name == "":
pytest.skip("https://github.com/milvus-io/milvus/issues/38223")
collection_w = self.init_collection_general(prefix, nb=10)[0]
partition_names = [partition_name]
collection_w.load()
2 changes: 1 addition & 1 deletion tests/python_client/utils/util_pymilvus.py
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
import numpy as np
import requests
from sklearn import preprocessing
from pymilvus import Milvus, DataType
from pymilvus import DataType
from utils.util_log import test_log as log
from utils.util_k8s import init_k8s_client_config