From 40d34f711e3b4396a0e325b07df0e9995f48c5b8 Mon Sep 17 00:00:00 2001 From: nico <109071306+NicoYuan1986@users.noreply.github.com> Date: Wed, 4 Sep 2024 10:37:03 +0800 Subject: [PATCH] test: update test cases (#35867) Signed-off-by: nico --- .../milvus_client/test_milvus_client_insert.py | 16 +++++++++------- tests/python_client/requirements.txt | 4 ++-- tests/python_client/testcases/test_collection.py | 4 ++-- tests/python_client/testcases/test_search.py | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/tests/python_client/milvus_client/test_milvus_client_insert.py b/tests/python_client/milvus_client/test_milvus_client_insert.py index fa47d7101da88..450b9009a8909 100644 --- a/tests/python_client/milvus_client/test_milvus_client_insert.py +++ b/tests/python_client/milvus_client/test_milvus_client_insert.py @@ -200,8 +200,9 @@ def test_milvus_client_insert_data_vector_field_missing(self): rng = np.random.default_rng(seed=19530) rows = [{default_primary_key_field_name: i, default_float_field_name: i * 1.0, default_string_field_name: str(i)} for i in range(default_nb)] - error = {ct.err_code: 1, ct.err_msg: f"Field vector don't match in entities[0]"} - client_w.insert(client, collection_name, data= rows, + error = {ct.err_code: 1, ct.err_msg: f"float vector field 'vector' is illegal, array type mismatch: " + f"invalid parameter[expected=need float vector][actual=got nil]"} + client_w.insert(client, collection_name, data=rows, check_task=CheckTasks.err_res, check_items=error) @pytest.mark.tags(CaseLabel.L1) @@ -219,8 +220,8 @@ def test_milvus_client_insert_data_id_field_missing(self): rng = np.random.default_rng(seed=19530) rows = [{default_vector_field_name: list(rng.random((1, default_dim))[0]), default_float_field_name: i * 1.0, default_string_field_name: str(i)} for i in range(default_nb)] - error = {ct.err_code: 1, ct.err_msg: f"Field id don't match in entities[0]"} - client_w.insert(client, collection_name, data= rows, + error = {ct.err_code: 1, ct.err_msg: f"currently not support vector field as PrimaryField: invalid parameter"} + client_w.insert(client, collection_name, data=rows, check_task=CheckTasks.err_res, check_items=error) @pytest.mark.tags(CaseLabel.L1) @@ -671,8 +672,9 @@ def test_milvus_client_upsert_data_vector_field_missing(self): rng = np.random.default_rng(seed=19530) rows = [{default_primary_key_field_name: i, default_float_field_name: i * 1.0, default_string_field_name: str(i)} for i in range(default_nb)] - error = {ct.err_code: 1, ct.err_msg: f"Field vector don't match in entities[0]"} - client_w.upsert(client, collection_name, data= rows, + error = {ct.err_code: 1, ct.err_msg: f"float vector field 'vector' is illegal, array type mismatch: " + f"invalid parameter[expected=need float vector][actual=got nil]"} + client_w.upsert(client, collection_name, data=rows, check_task=CheckTasks.err_res, check_items=error) @pytest.mark.tags(CaseLabel.L1) @@ -690,7 +692,7 @@ def test_milvus_client_upsert_data_id_field_missing(self): rng = np.random.default_rng(seed=19530) rows = [{default_vector_field_name: list(rng.random((1, default_dim))[0]), default_float_field_name: i * 1.0, default_string_field_name: str(i)} for i in range(default_nb)] - error = {ct.err_code: 1, ct.err_msg: f"Field id don't match in entities[0]"} + error = {ct.err_code: 1, ct.err_msg: f"currently not support vector field as PrimaryField: invalid parameter"} client_w.upsert(client, collection_name, data= rows, check_task=CheckTasks.err_res, check_items=error) diff --git a/tests/python_client/requirements.txt b/tests/python_client/requirements.txt index 523983569cdaa..219d27fd9b2b4 100644 --- a/tests/python_client/requirements.txt +++ b/tests/python_client/requirements.txt @@ -12,8 +12,8 @@ allure-pytest==2.7.0 pytest-print==0.2.1 pytest-level==0.1.1 pytest-xdist==2.5.0 -pymilvus==2.5.0rc70 -pymilvus[bulk_writer]==2.5.0rc70 +pymilvus==2.5.0rc74 +pymilvus[bulk_writer]==2.5.0rc74 pytest-rerunfailures==9.1.1 git+https://github.com/Projectplace/pytest-tags ndg-httpsclient diff --git a/tests/python_client/testcases/test_collection.py b/tests/python_client/testcases/test_collection.py index 667e1e8f6a546..4dfdc8c498363 100644 --- a/tests/python_client/testcases/test_collection.py +++ b/tests/python_client/testcases/test_collection.py @@ -2832,8 +2832,8 @@ def test_load_replica_change(self): assert loading_progress == {'loading_progress': '100%'} # verify load different replicas thrown an exception - error = {ct.err_code: 1100, ct.err_msg: "failed to load collection: can't change the replica number for " - "loaded collection: expected=1, actual=2: invalid parameter"} + error = {ct.err_code: 1100, ct.err_msg: "call query coordinator LoadCollection: can't change the replica number" + " for loaded collection: invalid parameter[expected=1][actual=2]"} collection_w.load(replica_number=2, check_task=CheckTasks.err_res, check_items=error) one_replica, _ = collection_w.get_replicas() assert len(one_replica.groups) == 1 diff --git a/tests/python_client/testcases/test_search.py b/tests/python_client/testcases/test_search.py index 9a8e9bb183ff3..a86f6e6569620 100644 --- a/tests/python_client/testcases/test_search.py +++ b/tests/python_client/testcases/test_search.py @@ -10445,7 +10445,7 @@ def test_search_group_by_unsupported_index(self, index): 3. search with group by verify: the error code and msg """ - if index in ["HNSW", "IVF_FLAT", "FLAT"]: + if index in ["HNSW", "IVF_FLAT", "FLAT", "IVF_SQ8"]: pass # Only HNSW and IVF_FLAT are supported else: metric = "L2"