Skip to content

Commit

Permalink
test: update test cases and sdk version
Browse files Browse the repository at this point in the history
Signed-off-by: nico <[email protected]>
  • Loading branch information
NicoYuan1986 committed Jan 20, 2025
1 parent 57ba8a7 commit 4bd1746
Show file tree
Hide file tree
Showing 7 changed files with 17 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 @@ -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")
Expand All @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand All @@ -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):
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 @@ -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.14rc7
pymilvus[bulk_writer]==2.4.14rc7
pytest-rerunfailures==9.1.1
git+https://github.com/Projectplace/pytest-tags
ndg-httpsclient
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 @@ -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)

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 @@ -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"}
Expand Down Expand Up @@ -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()
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 4bd1746

Please sign in to comment.