Skip to content

Commit

Permalink
test: add test case for auto id (#114)
Browse files Browse the repository at this point in the history
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
  • Loading branch information
zhuwenxing authored Mar 27, 2023
1 parent bb47366 commit 25c71c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/base/client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def prepare_data(self, name=None, nb=ct.default_nb, dim=ct.default_dim, is_binar
collection_w = self.init_collection_wrap(name=name, schema=default_schema, active_trace=True)
assert collection_w.name == name
if nb > 0:
cf.insert_data(collection_w, nb=nb, is_binary=is_binary, dim=dim)
cf.insert_data(collection_w, nb=nb, is_binary=is_binary, auto_id=auto_id, dim=dim)
if is_flushed:
collection_w.flush(timeout=180)
if check_function:
Expand Down
9 changes: 5 additions & 4 deletions tests/testcases/test_restore_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,26 @@ class TestRestoreBackup(TestcaseBase):

@pytest.mark.tags(CaseLabel.L1)
@pytest.mark.parametrize("nb", [0, 3000])
@pytest.mark.parametrize("is_auto_id", [True, False])
@pytest.mark.parametrize("is_async", [True, False])
@pytest.mark.parametrize("collection_need_to_restore", [1, 2, 3])
@pytest.mark.parametrize("collection_type", ["binary", "float", "all"])
def test_milvus_restore_back(self, collection_type, collection_need_to_restore, is_async, nb):
def test_milvus_restore_back(self, collection_type, collection_need_to_restore, is_async, is_auto_id, nb):
# prepare data
names_origin = []
back_up_name = cf.gen_unique_str(backup_prefix)
if collection_type == "all":
for is_binary in [True, False, False]:
names_origin.append(cf.gen_unique_str(prefix))
self.prepare_data(names_origin[-1], nb=nb, is_binary=is_binary, check_function=False)
self.prepare_data(names_origin[-1], nb=nb, is_binary=is_binary, auto_id=is_auto_id, check_function=False)
if collection_type == "float":
for is_binary in [False, False, False]:
names_origin.append(cf.gen_unique_str(prefix))
self.prepare_data(names_origin[-1], nb=nb, is_binary=is_binary, check_function=False)
self.prepare_data(names_origin[-1], nb=nb, is_binary=is_binary, auto_id=is_auto_id, check_function=False)
if collection_type == "binary":
for is_binary in [True, True, True]:
names_origin.append(cf.gen_unique_str(prefix))
self.prepare_data(names_origin[-1], nb=nb, is_binary=is_binary, check_function=False)
self.prepare_data(names_origin[-1], nb=nb, is_binary=is_binary, auto_id=is_auto_id, check_function=False)
log.info(f"name_origin:{names_origin}, back_up_name: {back_up_name}")
for name in names_origin:
res, _ = self.utility_wrap.has_collection(name)
Expand Down

0 comments on commit 25c71c7

Please sign in to comment.