mirror of https://github.com/milvus-io/milvus.git
Upgrade pymilvus version and update test cases (#19906)
Signed-off-by: Binbin Lv <binbin.lv@zilliz.com> Signed-off-by: Binbin Lv <binbin.lv@zilliz.com>pull/19909/head
parent
db0486c870
commit
7820610f78
|
@ -9,7 +9,7 @@ allure-pytest==2.7.0
|
|||
pytest-print==0.2.1
|
||||
pytest-level==0.1.1
|
||||
pytest-xdist==2.5.0
|
||||
pymilvus==2.2.0.dev49
|
||||
pymilvus==2.2.0.dev53
|
||||
pytest-rerunfailures==9.1.1
|
||||
git+https://github.com/Projectplace/pytest-tags
|
||||
ndg-httpsclient
|
||||
|
|
|
@ -96,7 +96,7 @@ class TestCollectionParams(TestcaseBase):
|
|||
"""
|
||||
self._connect()
|
||||
c_name = ""
|
||||
error = {ct.err_code: -1, ct.err_msg: f'`collection_name` value is illegal'}
|
||||
error = {ct.err_code: 1, ct.err_msg: f'`collection_name` value is illegal'}
|
||||
self.collection_wrap.init_collection(c_name, schema=default_schema, check_task=CheckTasks.err_res,
|
||||
check_items=error)
|
||||
|
||||
|
@ -285,7 +285,7 @@ class TestCollectionParams(TestcaseBase):
|
|||
"""
|
||||
self._connect()
|
||||
c_name = cf.gen_unique_str(prefix)
|
||||
error = {ct.err_code: 0, ct.err_msg: "Should be passed into the schema"}
|
||||
error = {ct.err_code: 1, ct.err_msg: "Collection '%s' not exist, or you can pass in schema to create one."}
|
||||
self.collection_wrap.init_collection(c_name, schema=None, check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
|
@ -2735,7 +2735,7 @@ class TestLoadPartition(TestcaseBase):
|
|||
)
|
||||
collection_w.create_index(ct.default_float_vec_field_name, index_params=ct.default_flat_index)
|
||||
partition_w.drop()
|
||||
error = {ct.err_code: 0, ct.err_msg: 'partitionID of partitionName:%s can not be find' % partition_name}
|
||||
error = {ct.err_code: 1, ct.err_msg: 'partitionID of partitionName:%s can not be find' % partition_name}
|
||||
partition_w.load(check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L0)
|
||||
|
@ -2775,7 +2775,7 @@ class TestLoadPartition(TestcaseBase):
|
|||
"is_empty": True, "num_entities": 0}
|
||||
)
|
||||
partition_w.drop()
|
||||
error = {ct.err_code: 0, ct.err_msg: 'partitionID of partitionName:%s can not be find' % partition_name}
|
||||
error = {ct.err_code: 1, ct.err_msg: 'Partition %s not exist.' % partition_name}
|
||||
partition_w.load(check_task=CheckTasks.err_res, check_items=error)
|
||||
partition_w.release(check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
|
@ -2797,7 +2797,7 @@ class TestLoadPartition(TestcaseBase):
|
|||
"is_empty": True, "num_entities": 0}
|
||||
)
|
||||
partition_w.drop()
|
||||
error = {ct.err_code: 0, ct.err_msg: 'partitionID of partitionName:%s can not be find' % partition_name}
|
||||
error = {ct.err_code: 1, ct.err_msg: 'partitionID of partitionName:%s can not be find' % partition_name}
|
||||
partition_w.release(check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L0)
|
||||
|
|
|
@ -48,7 +48,7 @@ class TestConnectionParams(TestcaseBase):
|
|||
|
||||
# check param of **kwargs
|
||||
self.connection_wrap.add_connection(_kwargs=data, check_task=ct.CheckTasks.err_res,
|
||||
check_items={ct.err_code: -1, ct.err_msg: cem.NoHostPort})
|
||||
check_items={ct.err_code: 1, ct.err_msg: cem.NoHostPort})
|
||||
|
||||
# get addr of default alias
|
||||
self.connection_wrap.get_connection_addr(alias=DefaultConfig.DEFAULT_USING, check_task=ct.CheckTasks.ccr,
|
||||
|
@ -73,7 +73,7 @@ class TestConnectionParams(TestcaseBase):
|
|||
# No check for **kwargs
|
||||
self.connection_wrap.connect(alias=DefaultConfig.DEFAULT_USING, host=1,
|
||||
check_task=ct.CheckTasks.err_res,
|
||||
check_items={ct.err_code: -1, ct.err_msg: cem.NoHostPort})
|
||||
check_items={ct.err_code: 1, ct.err_msg: cem.NoHostPort})
|
||||
|
||||
@pytest.mark.tags(ct.CaseLabel.L2)
|
||||
@pytest.mark.parametrize("alias", ct.get_not_string)
|
||||
|
@ -910,7 +910,7 @@ class TestConnectUriInvalid(TestcaseBase):
|
|||
|
||||
uri = "{}://{}:{}".format(protocol, host, port)
|
||||
self.connection_wrap.connect(alias=connect_name, uri=uri, check_task=ct.CheckTasks.err_res,
|
||||
check_items={ct.err_code: -1})
|
||||
check_items={ct.err_code: 1})
|
||||
|
||||
@pytest.mark.tags(ct.CaseLabel.L2)
|
||||
@pytest.mark.parametrize("host", ["256.256.256.256", "10.1.0"])
|
||||
|
|
|
@ -276,7 +276,7 @@ class TestInsertParams(TestcaseBase):
|
|||
df = cf.gen_default_dataframe_data(nb)
|
||||
new_float_value = pd.Series(data=[float(i) for i in range(nb)], dtype="float64")
|
||||
df.iloc[:, 1] = new_float_value
|
||||
error = {ct.err_code: 0, ct.err_msg: 'The types of schema and data do not match'}
|
||||
error = {ct.err_code: 1, ct.err_msg: 'The data fields number is not match with schema.'}
|
||||
collection_w.insert(data=df, check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
|
@ -293,7 +293,7 @@ class TestInsertParams(TestcaseBase):
|
|||
float_values = [np.float32(i) for i in range(nb)]
|
||||
float_vec_values = cf.gen_vectors(nb, ct.default_dim)
|
||||
data = [int_values, float_values, float_vec_values]
|
||||
error = {ct.err_code: 0, ct.err_msg: 'Arrays must all be same length.'}
|
||||
error = {ct.err_code: 1, ct.err_msg: 'Arrays must all be same length.'}
|
||||
collection_w.insert(data=data, check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
|
@ -310,7 +310,7 @@ class TestInsertParams(TestcaseBase):
|
|||
float_values = [np.float32(i) for i in range(nb)]
|
||||
float_vec_values = cf.gen_vectors(nb - 1, ct.default_dim)
|
||||
data = [int_values, float_values, float_vec_values]
|
||||
error = {ct.err_code: 0, ct.err_msg: 'Arrays must all be same length.'}
|
||||
error = {ct.err_code: 1, ct.err_msg: 'Arrays must all be same length.'}
|
||||
collection_w.insert(data=data, check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
|
@ -356,7 +356,7 @@ class TestInsertParams(TestcaseBase):
|
|||
float_values = [np.float32(i) for i in range(nb)]
|
||||
float_vec_values = cf.gen_vectors(nb, ct.default_dim)
|
||||
data = [float_values, int_values, float_vec_values]
|
||||
error = {ct.err_code: 0, ct.err_msg: 'The types of schema and data do not match'}
|
||||
error = {ct.err_code: 1, ct.err_msg: 'The data fields number is not match with schema.'}
|
||||
collection_w.insert(data=data, check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L1)
|
||||
|
@ -377,7 +377,7 @@ class TestInsertParams(TestcaseBase):
|
|||
ct.default_float_vec_field_name: float_vec_values,
|
||||
ct.default_int64_field_name: int_values
|
||||
})
|
||||
error = {ct.err_code: 0, ct.err_msg: 'The types of schema and data do not match'}
|
||||
error = {ct.err_code: 1, ct.err_msg: 'The data fields number is not match with schema.'}
|
||||
collection_w.insert(data=df, check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
|
@ -498,7 +498,7 @@ class TestInsertOperation(TestcaseBase):
|
|||
"""
|
||||
collection_w = self.init_collection_wrap(name=cf.gen_unique_str(prefix))
|
||||
df = cf.gen_collection_schema([cf.gen_int64_field(is_primary=True)])
|
||||
error = {ct.err_code: 0, ct.err_msg: "Primary key field can only be one"}
|
||||
error = {ct.err_code: 1, ct.err_msg: "Data type is not support."}
|
||||
collection_w.insert(data=df, check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
|
@ -513,7 +513,7 @@ class TestInsertOperation(TestcaseBase):
|
|||
field_one = cf.gen_int64_field(is_primary=True)
|
||||
field_two = cf.gen_int64_field()
|
||||
df = [field_one, field_two, vec_field]
|
||||
error = {ct.err_code: 0, ct.err_msg: "Field dtype must be of DataType."}
|
||||
error = {ct.err_code: 1, ct.err_msg: "Field dtype must be of DataType."}
|
||||
collection_w.insert(data=df, check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
|
@ -928,7 +928,7 @@ class TestInsertAsync(TestcaseBase):
|
|||
"""
|
||||
collection_w = self.init_collection_wrap(name=cf.gen_unique_str(prefix))
|
||||
df = cf.gen_collection_schema([cf.gen_int64_field(is_primary=True)])
|
||||
error = {ct.err_code: 0, ct.err_msg: "fleldSchema lack of vector field."}
|
||||
error = {ct.err_code: 1, ct.err_msg: "fleldSchema lack of vector field."}
|
||||
future, _ = collection_w.insert(data=df, _async=True, check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
|
||||
|
@ -1003,7 +1003,7 @@ class TestInsertInvalid(TestcaseBase):
|
|||
int_field = cf.gen_float_field(is_primary=True)
|
||||
vec_field = cf.gen_float_vec_field(name='vec')
|
||||
df = [int_field, vec_field]
|
||||
error = {ct.err_code: 0, ct.err_msg: "Primary key type must be DataType.INT64."}
|
||||
error = {ct.err_code: 1, ct.err_msg: "Primary key type must be DataType.INT64."}
|
||||
mutation_res, _ = collection_w.insert(data=df, check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
@pytest.mark.tags(CaseLabel.L2)
|
||||
|
@ -1033,7 +1033,7 @@ class TestInsertInvalid(TestcaseBase):
|
|||
field_two = cf.gen_int64_field()
|
||||
vec_field = ct.get_invalid_vectors
|
||||
df = [field_one, field_two, vec_field]
|
||||
error = {ct.err_code: 0, ct.err_msg: "The field of schema type must be FieldSchema."}
|
||||
error = {ct.err_code: 1, ct.err_msg: "Data type is not support."}
|
||||
mutation_res, _ = collection_w.insert(data=df, check_task=CheckTasks.err_res, check_items=error)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue