Skip to content

Commit

Permalink
test: update test cases and sdk version[2.5]
Browse files Browse the repository at this point in the history
Signed-off-by: nico <[email protected]>
  • Loading branch information
NicoYuan1986 committed Jan 23, 2025
1 parent 6cdabd9 commit 161e0ff
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/python_client/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,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")
Expand All @@ -359,7 +359,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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ def test_milvus_client_release_partition_name_lists_not_all_exists(self):
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
Expand Down
4 changes: 2 additions & 2 deletions tests/python_client/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ pytest-parallel
pytest-random-order

# pymilvus
pymilvus==2.5.3
pymilvus[bulk_writer]==2.5.3
pymilvus==2.5.4rc11
pymilvus[bulk_writer]==2.5.4rc11

# for customize config test
python-benedict==0.24.3
Expand Down
7 changes: 4 additions & 3 deletions tests/python_client/testcases/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,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:
Expand Down Expand Up @@ -1396,8 +1396,9 @@ def test_turning_on_mmap_for_scalar_index(self):
expected: raise exception
"""
collection_w = self.init_collection_general(prefix, is_index=False, is_all_data_type=True)[0]
scalar_index = ["Trie", "STL_SORT"]
scalar_fields = [ct.default_string_field_name, ct.default_int16_field_name]
# Trie support now
scalar_index = ["STL_SORT"]
scalar_fields = [ct.default_int16_field_name]
for i in range(len(scalar_fields)):
index_name = f"scalar_index_name_{i}"
scalar_index_params = {"index_type": f"{scalar_index[i]}"}
Expand Down
2 changes: 2 additions & 0 deletions tests/python_client/testcases/test_insert.py
Original file line number Diff line number Diff line change
Expand Up @@ -2288,6 +2288,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)

Expand Down
2 changes: 2 additions & 0 deletions tests/python_client/testcases/test_partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 4 additions & 0 deletions tests/python_client/testcases/test_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,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"}
Expand Down Expand Up @@ -288,6 +290,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()
Expand Down
2 changes: 1 addition & 1 deletion tests/python_client/utils/util_pymilvus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 161e0ff

Please sign in to comment.