未验证 提交 81d0056e 编写于 作者: J jingkl 提交者: GitHub

[test]modify the diskann testcase (#20807)

Signed-off-by: Njingkl <jingjing.jia@zilliz.com>
Signed-off-by: Njingkl <jingjing.jia@zilliz.com>
上级 44d45452
...@@ -1567,7 +1567,7 @@ class TestIndexDiskann(TestcaseBase): ...@@ -1567,7 +1567,7 @@ class TestIndexDiskann(TestcaseBase):
def call_back(self): def call_back(self):
assert True assert True
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L2)
def test_create_index_with_diskann_normal(self): def test_create_index_with_diskann_normal(self):
""" """
target: test create index with diskann target: test create index with diskann
...@@ -1593,7 +1593,7 @@ class TestIndexDiskann(TestcaseBase): ...@@ -1593,7 +1593,7 @@ class TestIndexDiskann(TestcaseBase):
check_items={"nq": default_nq, check_items={"nq": default_nq,
"limit": default_limit}) "limit": default_limit})
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L2)
def test_create_index_with_over_max_dim(self): def test_create_index_with_over_max_dim(self):
""" """
target: test create index with diskann target: test create index with diskann
...@@ -1612,7 +1612,7 @@ class TestIndexDiskann(TestcaseBase): ...@@ -1612,7 +1612,7 @@ class TestIndexDiskann(TestcaseBase):
check_items={ct.err_code: 1, check_items={ct.err_code: 1,
ct.err_msg: "invalid index params"}) ct.err_msg: "invalid index params"})
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L2)
def test_create_index_with_diskann_callback(self,_async): def test_create_index_with_diskann_callback(self,_async):
""" """
target: test create index with diskann target: test create index with diskann
...@@ -1641,7 +1641,8 @@ class TestIndexDiskann(TestcaseBase): ...@@ -1641,7 +1641,8 @@ class TestIndexDiskann(TestcaseBase):
check_task=CheckTasks.check_search_results, check_task=CheckTasks.check_search_results,
check_items={"nq": default_nq, check_items={"nq": default_nq,
"limit": default_limit}) "limit": default_limit})
@pytest.mark.tags(CaseLabel.L2)
def test_create_diskann_index_drop_with_async(self, _async): def test_create_diskann_index_drop_with_async(self, _async):
""" """
target: test create index interface target: test create index interface
...@@ -1662,7 +1663,7 @@ class TestIndexDiskann(TestcaseBase): ...@@ -1662,7 +1663,7 @@ class TestIndexDiskann(TestcaseBase):
collection_w.drop_index(index_name=ct.default_index_name) collection_w.drop_index(index_name=ct.default_index_name)
assert len(collection_w.indexes) == 0 assert len(collection_w.indexes) == 0
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L2)
def test_create_diskann_index_with_partition(self): def test_create_diskann_index_with_partition(self):
""" """
target: test create index with diskann target: test create index with diskann
...@@ -1689,7 +1690,7 @@ class TestIndexDiskann(TestcaseBase): ...@@ -1689,7 +1690,7 @@ class TestIndexDiskann(TestcaseBase):
assert collection_w.has_index(index_name=field_name)[0] == False assert collection_w.has_index(index_name=field_name)[0] == False
assert len(collection_w.indexes) == 0 assert len(collection_w.indexes) == 0
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L2)
def test_drop_diskann_index_with_noraml(self): def test_drop_diskann_index_with_noraml(self):
""" """
target: test drop diskann index normal target: test drop diskann index normal
...@@ -1709,7 +1710,7 @@ class TestIndexDiskann(TestcaseBase): ...@@ -1709,7 +1710,7 @@ class TestIndexDiskann(TestcaseBase):
collection_w.drop_index(index_name=index_name1) collection_w.drop_index(index_name=index_name1)
assert collection_w.has_index(index_name=index_name1)[0] == False assert collection_w.has_index(index_name=index_name1)[0] == False
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L2)
def test_drop_diskann_index_and_create_again(self): def test_drop_diskann_index_and_create_again(self):
""" """
target: test drop diskann index normal target: test drop diskann index normal
...@@ -1730,7 +1731,7 @@ class TestIndexDiskann(TestcaseBase): ...@@ -1730,7 +1731,7 @@ class TestIndexDiskann(TestcaseBase):
collection_w.create_index(default_field_name, ct.default_diskann_index) collection_w.create_index(default_field_name, ct.default_diskann_index)
assert len(collection_w.indexes) == 1 assert len(collection_w.indexes) == 1
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L2)
def test_create_more_than_three_index(self): def test_create_more_than_three_index(self):
""" """
target: test create diskann index target: test create diskann index
...@@ -1751,7 +1752,7 @@ class TestIndexDiskann(TestcaseBase): ...@@ -1751,7 +1752,7 @@ class TestIndexDiskann(TestcaseBase):
collection_w.create_index("float", default_params, index_name="c") collection_w.create_index("float", default_params, index_name="c")
assert collection_w.has_index(index_name="c")[0] == True assert collection_w.has_index(index_name="c")[0] == True
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L2)
def test_drop_diskann_index_with_partition(self): def test_drop_diskann_index_with_partition(self):
""" """
target: test drop diskann index normal target: test drop diskann index normal
...@@ -1773,7 +1774,7 @@ class TestIndexDiskann(TestcaseBase): ...@@ -1773,7 +1774,7 @@ class TestIndexDiskann(TestcaseBase):
collection_w.drop_index() collection_w.drop_index()
assert len(collection_w.indexes) == 0 assert len(collection_w.indexes) == 0
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L2)
def test_create_diskann_index_with_binary(self): def test_create_diskann_index_with_binary(self):
""" """
target: test create diskann index with binary target: test create diskann index with binary
...@@ -1790,7 +1791,7 @@ class TestIndexDiskann(TestcaseBase): ...@@ -1790,7 +1791,7 @@ class TestIndexDiskann(TestcaseBase):
check_items={ct.err_code: 1, check_items={ct.err_code: 1,
ct.err_msg: "field data type BinaryVector don't support the index build type DISKANN"}) ct.err_msg: "field data type BinaryVector don't support the index build type DISKANN"})
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L2)
def test_create_diskann_index_multithread(self): def test_create_diskann_index_multithread(self):
""" """
target: test create index interface with multiprocess target: test create index interface with multiprocess
......
...@@ -1672,7 +1672,7 @@ class TestqueryString(TestcaseBase): ...@@ -1672,7 +1672,7 @@ class TestqueryString(TestcaseBase):
assert len(res) == nb assert len(res) == nb
@pytest.mark.tags(CaseLabel.L0) @pytest.mark.tags(CaseLabel.L2)
def test_query_with_create_diskann_index(self): def test_query_with_create_diskann_index(self):
""" """
target: test query after create diskann index target: test query after create diskann index
...@@ -1691,7 +1691,7 @@ class TestqueryString(TestcaseBase): ...@@ -1691,7 +1691,7 @@ class TestqueryString(TestcaseBase):
check_vec = vectors[0].iloc[:, [0]][0:len(int_values)].to_dict('records') check_vec = vectors[0].iloc[:, [0]][0:len(int_values)].to_dict('records')
collection_w.query(term_expr, check_task=CheckTasks.check_query_results, check_items={exp_res: check_vec}) collection_w.query(term_expr, check_task=CheckTasks.check_query_results, check_items={exp_res: check_vec})
@pytest.mark.tags(CaseLabel.L0) @pytest.mark.tags(CaseLabel.L2)
def test_query_with_create_diskann_with_string_pk(self): def test_query_with_create_diskann_with_string_pk(self):
""" """
target: test query after create diskann index target: test query after create diskann index
......
...@@ -4222,7 +4222,7 @@ class TestsearchDiskann(TestcaseBase): ...@@ -4222,7 +4222,7 @@ class TestsearchDiskann(TestcaseBase):
def _async(self, request): def _async(self, request):
yield request.param yield request.param
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L2)
def test_search_with_diskann_index(self, dim, auto_id, _async): def test_search_with_diskann_index(self, dim, auto_id, _async):
""" """
target: test delete after creating index target: test delete after creating index
...@@ -4261,7 +4261,7 @@ class TestsearchDiskann(TestcaseBase): ...@@ -4261,7 +4261,7 @@ class TestsearchDiskann(TestcaseBase):
"_async": _async} "_async": _async}
) )
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L2)
@pytest.mark.parametrize("limit", [20]) @pytest.mark.parametrize("limit", [20])
@pytest.mark.parametrize("search_list", [10, 201]) @pytest.mark.parametrize("search_list", [10, 201])
def test_search_invalid_params_with_diskann_A(self, dim, auto_id, search_list, limit): def test_search_invalid_params_with_diskann_A(self, dim, auto_id, search_list, limit):
...@@ -4292,7 +4292,7 @@ class TestsearchDiskann(TestcaseBase): ...@@ -4292,7 +4292,7 @@ class TestsearchDiskann(TestcaseBase):
"err_msg": "fail to search on all shard leaders"} "err_msg": "fail to search on all shard leaders"}
) )
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L2)
@pytest.mark.parametrize("limit", [6553]) @pytest.mark.parametrize("limit", [6553])
@pytest.mark.parametrize("search_list", [6553, 65531]) @pytest.mark.parametrize("search_list", [6553, 65531])
def test_search_invalid_params_with_diskann_B(self, dim, auto_id, search_list, limit): def test_search_invalid_params_with_diskann_B(self, dim, auto_id, search_list, limit):
...@@ -4323,7 +4323,7 @@ class TestsearchDiskann(TestcaseBase): ...@@ -4323,7 +4323,7 @@ class TestsearchDiskann(TestcaseBase):
"err_msg": "fail to search on all shard leaders"} "err_msg": "fail to search on all shard leaders"}
) )
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L2)
@pytest.mark.parametrize("limit", [6554]) @pytest.mark.parametrize("limit", [6554])
@pytest.mark.parametrize("search_list", [6554, 65536]) @pytest.mark.parametrize("search_list", [6554, 65536])
def test_search_invalid_params_with_diskann_C(self, dim, auto_id, search_list, limit): def test_search_invalid_params_with_diskann_C(self, dim, auto_id, search_list, limit):
...@@ -4353,7 +4353,7 @@ class TestsearchDiskann(TestcaseBase): ...@@ -4353,7 +4353,7 @@ class TestsearchDiskann(TestcaseBase):
check_items={"err_code": 1, check_items={"err_code": 1,
"err_msg": "fail to search on all shard leaders"} "err_msg": "fail to search on all shard leaders"}
) )
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L2)
def test_search_with_diskann_with_string_pk(self, dim): def test_search_with_diskann_with_string_pk(self, dim):
""" """
target: test delete after creating index target: test delete after creating index
...@@ -4385,7 +4385,7 @@ class TestsearchDiskann(TestcaseBase): ...@@ -4385,7 +4385,7 @@ class TestsearchDiskann(TestcaseBase):
) )
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L2)
def test_search_with_delete_data(self, dim, auto_id, _async): def test_search_with_delete_data(self, dim, auto_id, _async):
""" """
target: test delete after creating index target: test delete after creating index
...@@ -4427,7 +4427,7 @@ class TestsearchDiskann(TestcaseBase): ...@@ -4427,7 +4427,7 @@ class TestsearchDiskann(TestcaseBase):
) )
@pytest.mark.tags(CaseLabel.L1) @pytest.mark.tags(CaseLabel.L2)
def test_search_with_diskann_and_more_index(self, dim, auto_id, _async): def test_search_with_diskann_and_more_index(self, dim, auto_id, _async):
""" """
target: test delete after creating index target: test delete after creating index
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册