mirror of https://github.com/milvus-io/milvus.git
test: update pymilvus version and test cases (#31827)
Signed-off-by: nico <cheng.yuan@zilliz.com>pull/31968/head
parent
ddf759abb2
commit
14a9785380
|
@ -124,7 +124,7 @@ class TestMilvusClientSearchInvalid(TestcaseBase):
|
|||
client = self._connect(enable_milvus_client_api=True)
|
||||
collection_name = cf.gen_unique_str(prefix)
|
||||
# 1. create collection
|
||||
error = {ct.err_code: 65535,
|
||||
error = {ct.err_code: 1100,
|
||||
ct.err_msg: "metric type not found or not supported, supported: [L2 IP COSINE HAMMING JACCARD]"}
|
||||
client_w.create_collection(client, collection_name, default_dim, metric_type="invalid",
|
||||
check_task=CheckTasks.err_res, check_items=error)
|
||||
|
|
|
@ -12,7 +12,7 @@ allure-pytest==2.7.0
|
|||
pytest-print==0.2.1
|
||||
pytest-level==0.1.1
|
||||
pytest-xdist==2.5.0
|
||||
pymilvus==2.5.0rc3
|
||||
pymilvus==2.5.0rc4
|
||||
pytest-rerunfailures==9.1.1
|
||||
git+https://github.com/Projectplace/pytest-tags
|
||||
ndg-httpsclient
|
||||
|
|
|
@ -1190,7 +1190,7 @@ class TestCollectionOperation(TestcaseBase):
|
|||
self.connection_wrap.remove_connection(ct.default_alias)
|
||||
res_list, _ = self.connection_wrap.list_connections()
|
||||
assert ct.default_alias not in res_list
|
||||
error = {ct.err_code: 0, ct.err_msg: 'should create connect first'}
|
||||
error = {ct.err_code: 1, ct.err_msg: 'should create connect first'}
|
||||
self.collection_wrap.init_collection(c_name, schema=default_schema,
|
||||
check_task=CheckTasks.err_res, check_items=error)
|
||||
assert self.collection_wrap.collection is None
|
||||
|
@ -2075,7 +2075,7 @@ class TestDropCollection(TestcaseBase):
|
|||
self.connection_wrap.remove_connection(ct.default_alias)
|
||||
res_list, _ = self.connection_wrap.list_connections()
|
||||
assert ct.default_alias not in res_list
|
||||
error = {ct.err_code: 0, ct.err_msg: 'should create connect first'}
|
||||
error = {ct.err_code: 1, ct.err_msg: 'should create connect first'}
|
||||
collection_wr.drop(check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L1)
|
||||
|
@ -2176,7 +2176,7 @@ class TestHasCollection(TestcaseBase):
|
|||
self.connection_wrap.remove_connection(ct.default_alias)
|
||||
res_list, _ = self.connection_wrap.list_connections()
|
||||
assert ct.default_alias not in res_list
|
||||
error = {ct.err_code: 0, ct.err_msg: 'should create connect first'}
|
||||
error = {ct.err_code: 1, ct.err_msg: 'should create connect first'}
|
||||
self.utility_wrap.has_collection(c_name, check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
|
@ -2291,7 +2291,7 @@ class TestListCollections(TestcaseBase):
|
|||
self.connection_wrap.remove_connection(ct.default_alias)
|
||||
res_list, _ = self.connection_wrap.list_connections()
|
||||
assert ct.default_alias not in res_list
|
||||
error = {ct.err_code: 0, ct.err_msg: 'should create connect first'}
|
||||
error = {ct.err_code: 1, ct.err_msg: 'should create connect first'}
|
||||
self.utility_wrap.list_collections(check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
|
@ -2384,7 +2384,7 @@ class TestLoadCollection(TestcaseBase):
|
|||
self.connection_wrap.remove_connection(ct.default_alias)
|
||||
res_list, _ = self.connection_wrap.list_connections()
|
||||
assert ct.default_alias not in res_list
|
||||
error = {ct.err_code: 0, ct.err_msg: 'should create connect first'}
|
||||
error = {ct.err_code: 1, ct.err_msg: 'should create connect first'}
|
||||
collection_wr.load(check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
|
@ -2400,7 +2400,7 @@ class TestLoadCollection(TestcaseBase):
|
|||
self.connection_wrap.remove_connection(ct.default_alias)
|
||||
res_list, _ = self.connection_wrap.list_connections()
|
||||
assert ct.default_alias not in res_list
|
||||
error = {ct.err_code: 0, ct.err_msg: 'should create connect first'}
|
||||
error = {ct.err_code: 1, ct.err_msg: 'should create connect first'}
|
||||
collection_wr.release(check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
|
@ -3413,7 +3413,7 @@ class TestLoadPartition(TestcaseBase):
|
|||
self.connection_wrap.remove_connection(ct.default_alias)
|
||||
res_list, _ = self.connection_wrap.list_connections()
|
||||
assert ct.default_alias not in res_list
|
||||
error = {ct.err_code: 0, ct.err_msg: 'should create connect first.'}
|
||||
error = {ct.err_code: 1, ct.err_msg: 'should create connect first.'}
|
||||
partition_w.load(check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
|
@ -3438,7 +3438,7 @@ class TestLoadPartition(TestcaseBase):
|
|||
self.connection_wrap.remove_connection(ct.default_alias)
|
||||
res_list, _ = self.connection_wrap.list_connections()
|
||||
assert ct.default_alias not in res_list
|
||||
error = {ct.err_code: 0, ct.err_msg: 'should create connect first.'}
|
||||
error = {ct.err_code: 1, ct.err_msg: 'should create connect first.'}
|
||||
partition_w.release(check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
|
|
|
@ -31,7 +31,7 @@ class TestCompactionParams(TestcaseBase):
|
|||
self.connection_wrap.remove_connection(ct.default_alias)
|
||||
res_list, _ = self.connection_wrap.list_connections()
|
||||
assert ct.default_alias not in res_list
|
||||
error = {ct.err_code: 0, ct.err_msg: "should create connect first"}
|
||||
error = {ct.err_code: 1, ct.err_msg: "should create connect first"}
|
||||
collection_w.compact(check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L1)
|
||||
|
|
|
@ -95,7 +95,7 @@ class TestDeleteParams(TestcaseBase):
|
|||
self.connection_wrap.remove_connection(ct.default_alias)
|
||||
res_list, _ = self.connection_wrap.list_connections()
|
||||
assert ct.default_alias not in res_list
|
||||
error = {ct.err_code: 0, ct.err_msg: "should create connect first"}
|
||||
error = {ct.err_code: 1, ct.err_msg: "should create connect first"}
|
||||
collection_w.delete(expr=tmp_expr, check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
# Not Milvus Exception
|
||||
|
|
|
@ -1020,7 +1020,7 @@ class TestNewIndexBase(TestcaseBase):
|
|||
index_name=ct.default_index_name)
|
||||
self.connection_wrap.remove_connection(ct.default_alias)
|
||||
collection_w.drop_index(index_name=ct.default_index_name, check_task=CheckTasks.err_res,
|
||||
check_items={ct.err_code: 0, ct.err_msg: "should create connect first."})
|
||||
check_items={ct.err_code: 1, ct.err_msg: "should create connect first."})
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
def test_create_drop_index_repeatedly_ip(self, get_simple_index):
|
||||
|
@ -1286,8 +1286,12 @@ class TestNewIndexBinary(TestcaseBase):
|
|||
c_name = cf.gen_unique_str(prefix)
|
||||
collection_w = self.init_collection_wrap(name=c_name, schema=default_binary_schema)
|
||||
binary_index_params = {'index_type': 'HNSW', "M": '18', "efConstruction": '240', 'metric_type': metric_type}
|
||||
collection_w.create_index(default_binary_vec_field_name, binary_index_params)
|
||||
assert collection_w.index()[0].params == binary_index_params
|
||||
collection_w.create_index(default_binary_vec_field_name, binary_index_params,
|
||||
check_task=CheckTasks.err_res,
|
||||
check_items={ct.err_code: 1100,
|
||||
ct.err_msg: "HNSW only support float vector data type: invalid "
|
||||
"parameter[expected=valid index params][actual=invalid "
|
||||
"index params]"})
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
@pytest.mark.parametrize("metric", ct.binary_metrics)
|
||||
|
@ -2299,9 +2303,12 @@ class TestAutoIndex(TestcaseBase):
|
|||
expected: raise exception
|
||||
"""
|
||||
collection_w = self.init_collection_general(prefix, is_binary=True, is_index=False)[0]
|
||||
collection_w.create_index(binary_field_name, {})
|
||||
actual_index_params = collection_w.index()[0].params
|
||||
assert default_autoindex_params == actual_index_params
|
||||
collection_w.create_index(binary_field_name, {},
|
||||
check_task=CheckTasks.err_res,
|
||||
check_items={ct.err_code: 1100,
|
||||
ct.err_msg: "HNSW only support float vector data type: invalid "
|
||||
"parameter[expected=valid index params][actual=invalid "
|
||||
"index params]"})
|
||||
|
||||
|
||||
@pytest.mark.tags(CaseLabel.GPU)
|
||||
|
|
|
@ -466,9 +466,8 @@ class TestInsertOperation(TestcaseBase):
|
|||
res_list, _ = self.connection_wrap.list_connections()
|
||||
assert ct.default_alias not in res_list
|
||||
data = cf.gen_default_list_data(10)
|
||||
error = {ct.err_code: 0, ct.err_msg: 'should create connect first'}
|
||||
collection_w.insert(
|
||||
data=data, check_task=CheckTasks.err_res, check_items=error)
|
||||
error = {ct.err_code: 1, ct.err_msg: 'should create connect first'}
|
||||
collection_w.insert(data=data, check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L1)
|
||||
def test_insert_default_partition(self):
|
||||
|
|
|
@ -2216,6 +2216,7 @@ class TestCollectionSearch(TestcaseBase):
|
|||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
@pytest.mark.tags(CaseLabel.GPU)
|
||||
@pytest.mark.skip("https://github.com/milvus-io/milvus/issues/31958")
|
||||
@pytest.mark.parametrize("index, params",
|
||||
zip(ct.all_index_types[:7],
|
||||
ct.default_index_params[:7]))
|
||||
|
@ -3165,6 +3166,7 @@ class TestCollectionSearch(TestcaseBase):
|
|||
assert set(ids).issubset(filter_ids_set)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
@pytest.mark.skip("https://github.com/milvus-io/milvus/issues/31958")
|
||||
@pytest.mark.parametrize("bool_type", [True, False, "true", "false"])
|
||||
def test_search_with_expression_bool(self, dim, auto_id, _async, bool_type, enable_dynamic_field):
|
||||
"""
|
||||
|
@ -3395,7 +3397,6 @@ class TestCollectionSearch(TestcaseBase):
|
|||
is_all_data_type=True,
|
||||
auto_id=auto_id,
|
||||
dim=dim,
|
||||
enable_dynamic_field=enable_dynamic_field,
|
||||
multiple_dim_array=[dim, dim])[0:4]
|
||||
# 2. search
|
||||
log.info("test_search_expression_all_data_type: Searching collection %s" %
|
||||
|
@ -4630,7 +4631,7 @@ class TestCollectionSearch(TestcaseBase):
|
|||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
@pytest.mark.parametrize("metrics", ct.binary_metrics[:2])
|
||||
@pytest.mark.parametrize("index", ["BIN_FLAT", "BIN_IVF_FLAT", "HNSW"])
|
||||
@pytest.mark.parametrize("index", ["BIN_FLAT", "BIN_IVF_FLAT"])
|
||||
@pytest.mark.parametrize("dim", [32768, 65536, ct.max_binary_vector_dim-8, ct.max_binary_vector_dim])
|
||||
def test_binary_indexed_large_dim_vectors_search(self, metrics, index, dim):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue