From 3430366d101ff4b42b0c77d6d29226c0666a925d Mon Sep 17 00:00:00 2001 From: zhuwenxing Date: Tue, 17 Dec 2024 10:33:05 +0800 Subject: [PATCH] test: simplify test cases Signed-off-by: zhuwenxing --- tests/base/client_base.py | 4 ++-- tests/testcases/test_restore_backup.py | 28 +++++++++++--------------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/tests/base/client_base.py b/tests/base/client_base.py index 152d64df..798cae23 100644 --- a/tests/base/client_base.py +++ b/tests/base/client_base.py @@ -265,8 +265,8 @@ def prepare_data(self, name=None, db_name="default", nb=ct.default_nb, dim=ct.de collection_w = self.init_collection_wrap(name=name, schema=default_schema, active_trace=True) # create partitions if enable_partition: - for i in range(5): - partition_w = self.init_partition_wrap(collection_wrap=collection_w) + for i in range(3): + self.init_partition_wrap(collection_wrap=collection_w) assert collection_w.name == name if nb > 0: cf.insert_data(collection_w, nb=nb, is_binary=is_binary, auto_id=auto_id, dim=dim) diff --git a/tests/testcases/test_restore_backup.py b/tests/testcases/test_restore_backup.py index 82d41eda..0f015640 100644 --- a/tests/testcases/test_restore_backup.py +++ b/tests/testcases/test_restore_backup.py @@ -88,7 +88,7 @@ def test_milvus_restore_back(self, collection_type, collection_need_to_restore, @pytest.mark.parametrize("is_auto_id", [True]) @pytest.mark.parametrize("enable_partition", [True]) @pytest.mark.parametrize("is_async", [True]) - @pytest.mark.parametrize("collection_need_to_restore", [3]) + @pytest.mark.parametrize("collection_need_to_restore", [1]) @pytest.mark.parametrize("collection_type", ["all"]) @pytest.mark.tags(CaseLabel.L0) def test_milvus_restore_back_with_multi_partition(self, collection_type, collection_need_to_restore, is_async, is_auto_id, enable_partition, nb): @@ -190,11 +190,11 @@ def test_milvus_restore_back_with_db_support(self): assert collection_name + suffix in res self.compare_collections(collection_name, collection_name + suffix) - @pytest.mark.parametrize("include_partition_key", [True, False]) - @pytest.mark.parametrize("include_dynamic", [True, False]) - @pytest.mark.parametrize("include_json", [True, False]) + @pytest.mark.parametrize("include_partition_key", [True]) + @pytest.mark.parametrize("include_dynamic", [True]) + @pytest.mark.parametrize("include_json", [True]) @pytest.mark.tags(CaseLabel.L0) - def test_milvus_restore_back_with_new_feature_support(self, include_json, include_dynamic, include_partition_key): + def test_milvus_restore_back_with_json_dynamic_schema_partition_key(self, include_json, include_dynamic, include_partition_key): self._connect() name_origin = cf.gen_unique_str(prefix) back_up_name = cf.gen_unique_str(backup_prefix) @@ -349,8 +349,7 @@ def test_milvus_restore_back_with_multi_json_datatype(self, include_json, includ all_backup = [] assert back_up_name not in all_backup - - @pytest.mark.parametrize("drop_db", [True, False]) + @pytest.mark.parametrize("drop_db", [True]) @pytest.mark.parametrize("str_json", [True, False]) @pytest.mark.tags(CaseLabel.L0) def test_milvus_restore_with_db_collections(self, drop_db, str_json): @@ -413,8 +412,8 @@ def test_milvus_restore_with_db_collections(self, drop_db, str_json): if not drop_db: self.compare_collections(collection_name, collection_name + suffix) - @pytest.mark.parametrize("include_partition_key", [True, False]) - @pytest.mark.parametrize("include_dynamic", [True, False]) + @pytest.mark.parametrize("include_partition_key", [True]) + @pytest.mark.parametrize("include_dynamic", [True]) @pytest.mark.tags(CaseLabel.L0) def test_milvus_restore_back_with_array_datatype(self, include_dynamic, include_partition_key): self._connect() @@ -488,9 +487,8 @@ def test_milvus_restore_back_with_array_datatype(self, include_dynamic, include_ all_backup = [] assert back_up_name not in all_backup - - @pytest.mark.parametrize("include_partition_key", [True, False]) - @pytest.mark.parametrize("include_dynamic", [True, False]) + @pytest.mark.parametrize("include_partition_key", [True]) + @pytest.mark.parametrize("include_dynamic", [True]) @pytest.mark.tags(CaseLabel.MASTER) def test_milvus_restore_back_with_multi_vector_datatype(self, include_dynamic, include_partition_key): self._connect() @@ -570,9 +568,8 @@ def test_milvus_restore_back_with_multi_vector_datatype(self, include_dynamic, i all_backup = [] assert back_up_name not in all_backup - - @pytest.mark.parametrize("include_partition_key", [True, False]) - @pytest.mark.parametrize("include_dynamic", [True, False]) + @pytest.mark.parametrize("include_partition_key", [True]) + @pytest.mark.parametrize("include_dynamic", [True]) @pytest.mark.tags(CaseLabel.MASTER) def test_milvus_restore_back_with_f16_bf16_datatype(self, include_dynamic, include_partition_key): self._connect() @@ -739,7 +736,6 @@ def test_milvus_restore_back_with_sparse_vector_datatype(self, include_dynamic, all_backup = [] assert back_up_name not in all_backup - @pytest.mark.tags(CaseLabel.L1) def test_milvus_restore_back_with_delete(self): self._connect()