Update regression tests

Signed-off-by: cai.zhang <cai.zhang@zilliz.com>
pull/4973/head^2
cai.zhang 2020-12-02 14:39:29 +08:00 committed by yefu.chen
parent 23aebe7e2a
commit 6c520a725d
7 changed files with 1843 additions and 12 deletions

View File

@ -4,5 +4,5 @@ numpy==1.18.1
pytest==5.3.4
pytest-cov==2.8.1
pytest-timeout==1.3.4
pymilvus-distributed==0.0.1
pymilvus-distributed==0.0.2
sklearn==0.0

View File

@ -563,7 +563,7 @@ class TestInsertBase:
milvus.flush([collection])
for i in range(thread_num):
t = TestThread(target=insert, args=(i,))
t = MilvusTestThread(target=insert, args=(i,))
threads.append(t)
t.start()
for t in threads:
@ -817,7 +817,6 @@ class TestInsertAsync:
future.result()
@pytest.mark.skip
class TestInsertMultiCollections:
"""
******************************************************************
@ -959,7 +958,6 @@ class TestInsertMultiCollections:
result = connect.search(collection_name, default_single_query)
@pytest.mark.skip
class TestInsertInvalid(object):
"""
Test inserting vectors with invalid collection names

View File

@ -4,7 +4,6 @@ from .constants import *
uid = "create_collection"
class TestCreateCollection:
"""
******************************************************************

View File

@ -55,7 +55,7 @@ class TestHasCollection:
assert connect.has_collection(collection_name)
# assert not assert_collection(connect, collection_name)
for i in range(threads_num):
t = TestThread(target=has, args=())
t = MilvusTestThread(target=has, args=())
threads.append(t)
t.start()
time.sleep(0.2)

View File

@ -20,6 +20,7 @@ class TestCreateBase:
@pytest.mark.level(2)
@pytest.mark.timeout(600)
@pytest.mark.skip
def test_create_partition_limit(self, connect, collection, args):
'''
target: test create partitions, check status returned

1831
tests/python/test_search.py Normal file

File diff suppressed because it is too large Load Diff

View File

@ -235,7 +235,7 @@ def gen_single_filter_fields():
def gen_single_vector_fields():
fields = []
for data_type in [DataType.FLOAT_VECTOR, DataType.BINARY_VECTOR]:
field = {"name": data_type.name, "type": data_type, "params": {"dim": default_dim}}
field = {"name": data_type.name, "type": data_type, "params": {"dim": default_dim}, "indexes": [{"metric_type": "L2"}]}
fields.append(field)
return fields
@ -243,9 +243,11 @@ def gen_single_vector_fields():
def gen_default_fields(auto_id=True):
default_fields = {
"fields": [
{"name": "int64", "type": DataType.INT64},
{"name": "int64", "type": DataType.INT64, "is_primary_key": not auto_id},
{"name": "float", "type": DataType.FLOAT},
{"name": default_float_vec_field_name, "type": DataType.FLOAT_VECTOR, "params": {"dim": default_dim}},
{"name": default_float_vec_field_name, "type": DataType.FLOAT_VECTOR,
"params": {"dim": default_dim},
"indexes": [{"metric_type": "L2"}]},
],
"segment_row_limit": default_segment_row_limit,
"auto_id": auto_id
@ -974,19 +976,19 @@ def restart_server(helm_release_name):
return res
class TestThread(threading.Thread):
class MilvusTestThread(threading.Thread):
def __init__(self, target, args=()):
threading.Thread.__init__(self, target=target, args=args)
def run(self):
self.exc = None
try:
super(TestThread, self).run()
super(MilvusTestThread, self).run()
except BaseException as e:
self.exc = e
def join(self):
super(TestThread, self).join()
super(MilvusTestThread, self).join()
if self.exc:
raise self.exc