Skip to content

Commit

Permalink
test: simplify test cases
Browse files Browse the repository at this point in the history
Signed-off-by: zhuwenxing <[email protected]>
  • Loading branch information
zhuwenxing committed Dec 17, 2024
1 parent e22a744 commit 3430366
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
4 changes: 2 additions & 2 deletions tests/base/client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
28 changes: 12 additions & 16 deletions tests/testcases/test_restore_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 3430366

Please sign in to comment.