mirror of https://github.com/milvus-io/milvus.git
Add l1 tag for pytest cases
Signed-off-by: del-zhenwu <zhenxiang.li@zilliz.com>pull/4973/head^2
parent
4b831ee39c
commit
c80641d47b
|
@ -54,7 +54,7 @@ timeout(time: 150, unit: 'MINUTES') {
|
|||
echo "This is Cron Job!"
|
||||
sh "pytest --tags=0331 --ip ${env.HELM_RELEASE_NAME}-milvus-ha.${env.HELM_RELEASE_NAMESPACE}.svc.cluster.local"
|
||||
} else {
|
||||
sh "pytest --tags=0331 --ip ${env.HELM_RELEASE_NAME}-milvus-ha.${env.HELM_RELEASE_NAMESPACE}.svc.cluster.local"
|
||||
sh "pytest --tags=0331+l1 --ip ${env.HELM_RELEASE_NAME}-milvus-ha.${env.HELM_RELEASE_NAMESPACE}.svc.cluster.local"
|
||||
}
|
||||
}
|
||||
} catch (exc) {
|
||||
|
|
|
@ -33,7 +33,7 @@ class TestCollectionCount:
|
|||
def get_simple_index(self, request, connect):
|
||||
return request.param
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_collection_count(self, connect, collection, insert_count):
|
||||
'''
|
||||
target: test collection rows_count is correct or not
|
||||
|
@ -48,7 +48,7 @@ class TestCollectionCount:
|
|||
stats = connect.get_collection_stats(collection)
|
||||
assert stats[row_count] == insert_count
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_collection_count_partition(self, connect, collection, insert_count):
|
||||
'''
|
||||
target: test collection rows_count is correct or not
|
||||
|
@ -138,7 +138,7 @@ class TestCollectionCount:
|
|||
# stats = connect.get_collection_stats(collection)
|
||||
# assert stats[row_count] == insert_count * 2
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_collection_count_after_index_created(self, connect, collection, get_simple_index, insert_count):
|
||||
'''
|
||||
target: test count_entities, after index have been created
|
||||
|
@ -162,7 +162,7 @@ class TestCollectionCount:
|
|||
with pytest.raises(Exception) as e:
|
||||
dis_connect.count_entities(collection)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_collection_count_no_vectors(self, connect, collection):
|
||||
'''
|
||||
target: test collection rows_count is correct or not, if collection is empty
|
||||
|
@ -265,7 +265,7 @@ class TestCollectionCountBinary:
|
|||
request.param["metric_type"] = "SUPERSTRUCTURE"
|
||||
return request.param
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_collection_count(self, connect, binary_collection, insert_count):
|
||||
'''
|
||||
target: test collection rows_count is correct or not
|
||||
|
@ -280,7 +280,7 @@ class TestCollectionCountBinary:
|
|||
stats = connect.get_collection_stats(binary_collection)
|
||||
assert stats[row_count] == insert_count
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_collection_count_partition(self, connect, binary_collection, insert_count):
|
||||
'''
|
||||
target: test collection rows_count is correct or not
|
||||
|
@ -373,7 +373,7 @@ class TestCollectionCountBinary:
|
|||
# assert stats[row_count] == insert_count * 2
|
||||
|
||||
# TODO: need to update and enable
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_collection_count_after_index_created(self, connect, binary_collection, get_jaccard_index, insert_count):
|
||||
'''
|
||||
target: test count_entities, after index have been created
|
||||
|
@ -389,7 +389,7 @@ class TestCollectionCountBinary:
|
|||
|
||||
# TODO: need to update and enable
|
||||
@pytest.mark.tags("0331")
|
||||
def test_collection_count_after_index_created(self, connect, binary_collection, get_hamming_index, insert_count):
|
||||
def test_collection_count_after_index_created_A(self, connect, binary_collection, get_hamming_index, insert_count):
|
||||
'''
|
||||
target: test count_entities, after index have been created
|
||||
method: add vectors in db, and create index, then calling count_entities with correct params
|
||||
|
@ -431,7 +431,7 @@ class TestCollectionMultiCollections:
|
|||
def insert_count(self, request):
|
||||
yield request.param
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_collection_count_multi_collections_l2(self, connect, insert_count):
|
||||
'''
|
||||
target: test collection rows_count is correct or not with multiple collections of L2
|
||||
|
@ -476,7 +476,7 @@ class TestCollectionMultiCollections:
|
|||
assert stats[row_count] == insert_count
|
||||
|
||||
@pytest.mark.level(2)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_collection_count_multi_collections_mix(self, connect):
|
||||
'''
|
||||
target: test collection rows_count is correct or not with multiple collections of JACCARD
|
||||
|
|
|
@ -58,7 +58,7 @@ class TestGetCollectionStats:
|
|||
def insert_count(self, request):
|
||||
yield request.param
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_get_collection_stats_name_not_existed(self, connect, collection):
|
||||
'''
|
||||
target: get collection stats where collection name does not exist
|
||||
|
@ -81,7 +81,7 @@ class TestGetCollectionStats:
|
|||
with pytest.raises(Exception) as e:
|
||||
connect.get_collection_stats(collection_name)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_get_collection_stats_empty(self, connect, collection):
|
||||
'''
|
||||
target: get collection stats where no entity in collection
|
||||
|
@ -102,7 +102,7 @@ class TestGetCollectionStats:
|
|||
with pytest.raises(Exception) as e:
|
||||
dis_connect.get_collection_stats(collection)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_get_collection_stats_batch(self, connect, collection):
|
||||
'''
|
||||
target: get row count with collection_stats
|
||||
|
@ -115,7 +115,7 @@ class TestGetCollectionStats:
|
|||
stats = connect.get_collection_stats(collection)
|
||||
assert int(stats[row_count]) == default_nb
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_get_collection_stats_single(self, connect, collection):
|
||||
'''
|
||||
target: get row count with collection_stats
|
||||
|
@ -204,7 +204,7 @@ class TestGetCollectionStats:
|
|||
stats = connect.get_collection_stats(collection)
|
||||
assert stats[row_count] == default_nb
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_get_collection_stats_partitions(self, connect, collection):
|
||||
'''
|
||||
target: get partition info in a collection
|
||||
|
@ -261,7 +261,7 @@ class TestGetCollectionStats:
|
|||
stats = connect.get_collection_stats(collection)
|
||||
assert stats[row_count] == insert_count
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_get_collection_stats_partitions_C(self, connect, collection, insert_count):
|
||||
'''
|
||||
target: test collection rows_count is correct or not
|
||||
|
@ -298,7 +298,7 @@ class TestGetCollectionStats:
|
|||
assert stats[row_count] == insert_count*2
|
||||
|
||||
# TODO: assert metric type in stats response
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_get_collection_stats_after_index_created(self, connect, collection, get_simple_index):
|
||||
'''
|
||||
target: test collection info after index created
|
||||
|
@ -342,7 +342,7 @@ class TestGetCollectionStats:
|
|||
stats = connect.get_collection_stats(binary_collection)
|
||||
assert stats[row_count] == default_nb
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_get_collection_stats_after_create_different_index(self, connect, collection):
|
||||
'''
|
||||
target: test collection info after index created repeatedly
|
||||
|
@ -357,7 +357,7 @@ class TestGetCollectionStats:
|
|||
stats = connect.get_collection_stats(collection)
|
||||
assert stats[row_count] == default_nb
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_collection_count_multi_collections(self, connect):
|
||||
'''
|
||||
target: test collection rows_count is correct or not with multiple collections of L2
|
||||
|
|
|
@ -41,7 +41,7 @@ class TestCreateCollection:
|
|||
def get_segment_row_limit(self, request):
|
||||
yield request.param
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_create_collection_fields(self, connect, get_filter_field, get_vector_field):
|
||||
'''
|
||||
target: test create normal collection with different fields
|
||||
|
@ -72,7 +72,7 @@ class TestCreateCollection:
|
|||
connect.create_collection(collection_name, fields)
|
||||
assert connect.has_collection(collection_name)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_create_collection_after_insert(self, connect, collection):
|
||||
'''
|
||||
target: test insert vector, then create collection again
|
||||
|
@ -90,7 +90,7 @@ class TestCreateCollection:
|
|||
message = getattr(e, 'message', "The exception does not contain the field of message.")
|
||||
assert message == "Create collection failed: collection %s exist" % collection
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_create_collection_after_insert_flush(self, connect, collection):
|
||||
'''
|
||||
target: test insert vector, then create collection again
|
||||
|
@ -119,7 +119,7 @@ class TestCreateCollection:
|
|||
with pytest.raises(Exception) as e:
|
||||
dis_connect.create_collection(collection_name, default_fields)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_create_collection_existed(self, connect):
|
||||
'''
|
||||
target: test create collection but the collection name have already existed
|
||||
|
@ -136,7 +136,7 @@ class TestCreateCollection:
|
|||
message = getattr(e, 'message', "The exception does not contain the field of message.")
|
||||
assert message == "Create collection failed: collection %s exist" % collection_name
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_create_after_drop_collection(self, connect, collection):
|
||||
'''
|
||||
target: create with the same collection name after collection dropped
|
||||
|
@ -236,7 +236,7 @@ class TestCreateCollectionInvalid(object):
|
|||
connect.create_collection(collection_name, fields)
|
||||
|
||||
@pytest.mark.level(2)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_create_collection_with_invalid_collection_name(self, connect, get_invalid_string):
|
||||
collection_name = get_invalid_string
|
||||
with pytest.raises(Exception) as e:
|
||||
|
|
|
@ -39,7 +39,7 @@ class TestDescribeCollection:
|
|||
The following cases are used to test `describe_collection` function, no data in collection
|
||||
******************************************************************
|
||||
"""
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_collection_fields(self, connect, get_filter_field, get_vector_field):
|
||||
'''
|
||||
target: test create normal collection with different fields, check info returned
|
||||
|
@ -65,7 +65,7 @@ class TestDescribeCollection:
|
|||
assert field["name"] == vector_field["name"]
|
||||
assert field["params"] == vector_field["params"]
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_describe_collection_after_index_created(self, connect, collection, get_simple_index):
|
||||
connect.create_index(collection, default_float_vec_field_name, get_simple_index)
|
||||
index = connect.describe_index(collection, default_float_vec_field_name)
|
||||
|
@ -84,7 +84,7 @@ class TestDescribeCollection:
|
|||
with pytest.raises(Exception) as e:
|
||||
dis_connect.describe_collection(collection)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_describe_collection_not_existed(self, connect):
|
||||
'''
|
||||
target: test if collection not created
|
||||
|
@ -133,7 +133,7 @@ class TestDescribeCollection:
|
|||
The following cases are used to test `describe_collection` function, and insert data in collection
|
||||
******************************************************************
|
||||
"""
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_describe_collection_fields_after_insert(self, connect, get_filter_field, get_vector_field):
|
||||
'''
|
||||
target: test create normal collection with different fields, check info returned
|
||||
|
|
|
@ -17,7 +17,7 @@ class TestDropCollection:
|
|||
The following cases are used to test `drop_collection` function
|
||||
******************************************************************
|
||||
"""
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_drop_collection_A(self, connect, collection):
|
||||
'''
|
||||
target: test delete collection created with correct params
|
||||
|
@ -39,7 +39,7 @@ class TestDropCollection:
|
|||
with pytest.raises(Exception) as e:
|
||||
dis_connect.drop_collection(collection)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_drop_collection_not_existed(self, connect):
|
||||
'''
|
||||
target: test if collection not created
|
||||
|
@ -57,7 +57,7 @@ class TestDropCollection:
|
|||
assert message == "describe collection failed: can't find collection: %s" % collection_name
|
||||
|
||||
@pytest.mark.level(2)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_create_drop_collection_multithread(self, connect):
|
||||
'''
|
||||
target: test create and drop collection with multithread
|
||||
|
|
|
@ -17,7 +17,7 @@ class TestHasCollection:
|
|||
The following cases are used to test `has_collection` function
|
||||
******************************************************************
|
||||
"""
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_has_collection(self, connect, collection):
|
||||
'''
|
||||
target: test if the created collection existed
|
||||
|
@ -37,7 +37,7 @@ class TestHasCollection:
|
|||
with pytest.raises(Exception) as e:
|
||||
assert dis_connect.has_collection(collection)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_has_collection_not_existed(self, connect):
|
||||
'''
|
||||
target: test if collection not created
|
||||
|
|
|
@ -12,7 +12,7 @@ class TestListCollections:
|
|||
The following cases are used to test `list_collections` function
|
||||
******************************************************************
|
||||
"""
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_list_collections(self, connect, collection):
|
||||
'''
|
||||
target: test list collections
|
||||
|
@ -21,7 +21,7 @@ class TestListCollections:
|
|||
'''
|
||||
assert collection in connect.list_collections()
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_list_collections_multi_collections(self, connect):
|
||||
'''
|
||||
target: test list collections
|
||||
|
|
|
@ -36,7 +36,7 @@ class TestLoadCollection:
|
|||
def get_binary_index(self, request, connect):
|
||||
return request.param
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_load_collection_after_index(self, connect, collection, get_simple_index):
|
||||
'''
|
||||
target: test load collection, after index created
|
||||
|
@ -73,7 +73,7 @@ class TestLoadCollection:
|
|||
connect.load_collection(binary_collection)
|
||||
connect.release_collection(binary_collection)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_load_empty_collection(self, connect, collection):
|
||||
'''
|
||||
target: test load collection
|
||||
|
@ -129,7 +129,7 @@ class TestLoadCollection:
|
|||
message = getattr(e, 'message', "The exception does not contain the field of message.")
|
||||
assert message == "describe collection failed: can't find collection: %s" % collection_name
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_release_collection_not_load(self, connect, collection):
|
||||
"""
|
||||
target: test release collection without load
|
||||
|
@ -141,7 +141,7 @@ class TestLoadCollection:
|
|||
connect.flush([collection])
|
||||
connect.release_collection(collection)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_load_collection_after_load_release(self, connect, collection):
|
||||
ids = connect.insert(collection, default_entities)
|
||||
assert len(ids) == default_nb
|
||||
|
@ -184,7 +184,7 @@ class TestLoadCollection:
|
|||
message = getattr(e, 'message', "The exception does not contain the field of message.")
|
||||
assert message == "describe collection failed: can't find collection: %s" % collection_name
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_release_collection_after_drop(self, connect, collection):
|
||||
"""
|
||||
target: test release collection after drop
|
||||
|
@ -204,7 +204,7 @@ class TestLoadCollection:
|
|||
message = getattr(e, 'message', "The exception does not contain the field of message.")
|
||||
assert message == "describe collection failed: can't find collection: %s" % collection
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_load_collection_without_flush(self, connect, collection):
|
||||
"""
|
||||
target: test load collection without flush
|
||||
|
@ -223,7 +223,7 @@ class TestLoadCollection:
|
|||
expected: raise exception
|
||||
"""
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_load_collection_release_part_partitions(self, connect, collection):
|
||||
"""
|
||||
target: test release part partitions after load collection
|
||||
|
@ -261,7 +261,7 @@ class TestLoadCollection:
|
|||
with pytest.raises(Exception) as e:
|
||||
connect.search(collection, default_single_query)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_load_partitions_release_collection(self, connect, collection):
|
||||
"""
|
||||
target: test release collection after load partitions
|
||||
|
@ -281,7 +281,7 @@ class TestLoadCollection:
|
|||
|
||||
class TestReleaseAdvanced:
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_release_collection_during_searching(self, connect, collection):
|
||||
"""
|
||||
target: test release collection during searching
|
||||
|
@ -318,7 +318,7 @@ class TestReleaseAdvanced:
|
|||
with pytest.raises(Exception):
|
||||
res = connect.search(collection, default_single_query)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_release_collection_during_searching_A(self, connect, collection):
|
||||
"""
|
||||
target: test release collection during searching
|
||||
|
@ -466,7 +466,7 @@ class TestLoadPartition:
|
|||
else:
|
||||
pytest.skip("Skip index Temporary")
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_load_partition_after_index(self, connect, collection, get_simple_index):
|
||||
'''
|
||||
target: test load collection, after index created
|
||||
|
@ -485,7 +485,7 @@ class TestLoadPartition:
|
|||
assert len(res[0]) == default_top_k
|
||||
|
||||
@pytest.mark.level(2)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_load_partition_after_index_binary(self, connect, binary_collection, get_binary_index):
|
||||
'''
|
||||
target: test load binary_collection, after index created
|
||||
|
@ -506,7 +506,7 @@ class TestLoadPartition:
|
|||
connect.create_index(binary_collection, default_binary_vec_field_name, get_binary_index)
|
||||
connect.load_partitions(binary_collection, [default_tag])
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_load_empty_partition(self, connect, collection):
|
||||
'''
|
||||
target: test load collection
|
||||
|
@ -544,7 +544,7 @@ class TestLoadPartition:
|
|||
dis_connect.release_partitions(collection, [default_tag])
|
||||
|
||||
@pytest.mark.level(2)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_load_partition_not_existed(self, connect, collection):
|
||||
partition_name = gen_unique_str(uid)
|
||||
try:
|
||||
|
@ -556,7 +556,7 @@ class TestLoadPartition:
|
|||
assert message == "partitionID of partitionName:%s can not be find" % partition_name
|
||||
|
||||
@pytest.mark.level(2)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_release_partition_not_existed(self, connect, collection):
|
||||
partition_name = gen_unique_str(uid)
|
||||
try:
|
||||
|
@ -567,7 +567,7 @@ class TestLoadPartition:
|
|||
message = getattr(e, 'message', "The exception does not contain the field of message.")
|
||||
assert message == "partitionID of partitionName:%s can not be find" % partition_name
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_release_partition_not_load(self, connect, collection):
|
||||
"""
|
||||
target: test release collection without load
|
||||
|
@ -606,7 +606,7 @@ class TestLoadPartition:
|
|||
message = getattr(e, 'message', "The exception does not contain the field of message.")
|
||||
assert message == "partitionID of partitionName:%s can not be find" % default_tag
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_release_partition_after_drop(self, connect, collection):
|
||||
"""
|
||||
target: test release collection after drop
|
||||
|
@ -627,7 +627,7 @@ class TestLoadPartition:
|
|||
message = getattr(e, 'message', "The exception does not contain the field of message.")
|
||||
assert message == "partitionID of partitionName:%s can not be find" % default_tag
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_load_release_after_collection_drop(self, connect, collection):
|
||||
"""
|
||||
target: test release collection after drop
|
||||
|
|
|
@ -49,7 +49,7 @@ class TestInsertBase:
|
|||
def get_vector_field(self, request):
|
||||
yield request.param
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_with_empty_entity(self, connect, collection):
|
||||
'''
|
||||
target: test insert with empty entity list
|
||||
|
@ -60,7 +60,7 @@ class TestInsertBase:
|
|||
with pytest.raises(ParamError) as e:
|
||||
connect.insert(collection, entities)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_with_None(self, connect, collection):
|
||||
'''
|
||||
target: test insert with None
|
||||
|
@ -72,7 +72,7 @@ class TestInsertBase:
|
|||
connect.insert(collection, entity)
|
||||
|
||||
@pytest.mark.timeout(ADD_TIMEOUT)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_collection_not_existed(self, connect):
|
||||
'''
|
||||
target: test insert, with collection not existed
|
||||
|
@ -108,7 +108,7 @@ class TestInsertBase:
|
|||
assert connect.has_collection(collection) == False
|
||||
|
||||
@pytest.mark.timeout(ADD_TIMEOUT)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_flush_drop_collection(self, connect, collection):
|
||||
'''
|
||||
target: test drop collection after insert entities for a while
|
||||
|
@ -137,7 +137,7 @@ class TestInsertBase:
|
|||
assert index == get_simple_index
|
||||
|
||||
@pytest.mark.timeout(ADD_TIMEOUT)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_after_create_index(self, connect, collection, get_simple_index):
|
||||
'''
|
||||
target: test build index insert after vector
|
||||
|
@ -151,7 +151,7 @@ class TestInsertBase:
|
|||
assert index == get_simple_index
|
||||
|
||||
@pytest.mark.timeout(ADD_TIMEOUT)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_search(self, connect, collection):
|
||||
'''
|
||||
target: test search entity after insert entity after a while
|
||||
|
@ -185,7 +185,7 @@ class TestInsertBase:
|
|||
yield request.param
|
||||
|
||||
@pytest.mark.timeout(ADD_TIMEOUT)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_ids(self, connect, id_collection, insert_count):
|
||||
'''
|
||||
target: test insert entities in collection, use customize ids
|
||||
|
@ -219,7 +219,7 @@ class TestInsertBase:
|
|||
assert stats[row_count] == nb
|
||||
|
||||
@pytest.mark.timeout(ADD_TIMEOUT)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_ids_fields(self, connect, get_filter_field, get_vector_field):
|
||||
'''
|
||||
target: test create normal collection with different fields, insert entities into id with ids
|
||||
|
@ -258,7 +258,7 @@ class TestInsertBase:
|
|||
|
||||
# TODO
|
||||
@pytest.mark.timeout(ADD_TIMEOUT)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_twice_ids_no_ids(self, connect, id_collection):
|
||||
'''
|
||||
target: check the result of insert, with params ids and no ids
|
||||
|
@ -282,7 +282,7 @@ class TestInsertBase:
|
|||
connect.insert(id_collection, default_entities)
|
||||
|
||||
@pytest.mark.timeout(ADD_TIMEOUT)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_ids_length_not_match_batch(self, connect, id_collection):
|
||||
'''
|
||||
target: test insert vectors in collection, use customize ids, len(ids) != len(vectors)
|
||||
|
@ -308,7 +308,7 @@ class TestInsertBase:
|
|||
connect.insert(id_collection, default_entity, ids)
|
||||
|
||||
@pytest.mark.timeout(ADD_TIMEOUT)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_partition(self, connect, collection):
|
||||
'''
|
||||
target: test insert entities in collection created before
|
||||
|
@ -325,7 +325,7 @@ class TestInsertBase:
|
|||
|
||||
# TODO
|
||||
@pytest.mark.timeout(ADD_TIMEOUT)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_partition_with_ids(self, connect, id_collection):
|
||||
'''
|
||||
target: test insert entities in collection created before, insert with ids
|
||||
|
@ -339,7 +339,7 @@ class TestInsertBase:
|
|||
logging.getLogger().info(connect.describe_collection(id_collection))
|
||||
|
||||
@pytest.mark.timeout(ADD_TIMEOUT)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_default_partition(self, connect, collection):
|
||||
'''
|
||||
target: test insert entities into default partition
|
||||
|
@ -379,7 +379,7 @@ class TestInsertBase:
|
|||
res = connect.get_collection_stats(collection)
|
||||
assert res[row_count] == 2 * default_nb
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_dim_not_matched(self, connect, collection):
|
||||
'''
|
||||
target: test insert entities, the vector dimension is not equal to the collection dimension
|
||||
|
@ -392,7 +392,7 @@ class TestInsertBase:
|
|||
with pytest.raises(Exception) as e:
|
||||
connect.insert(collection, insert_entities)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_with_field_name_not_match(self, connect, collection):
|
||||
'''
|
||||
target: test insert entities, with the entity field name updated
|
||||
|
@ -427,7 +427,7 @@ class TestInsertBase:
|
|||
with pytest.raises(Exception):
|
||||
connect.insert(collection, tmp_entity)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_with_field_more(self, connect, collection):
|
||||
'''
|
||||
target: test insert entities, with more fields than collection schema
|
||||
|
@ -438,7 +438,7 @@ class TestInsertBase:
|
|||
with pytest.raises(Exception):
|
||||
connect.insert(collection, tmp_entity)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_with_field_vector_more(self, connect, collection):
|
||||
'''
|
||||
target: test insert entities, with more fields than collection schema
|
||||
|
@ -449,7 +449,7 @@ class TestInsertBase:
|
|||
with pytest.raises(Exception):
|
||||
connect.insert(collection, tmp_entity)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_with_field_less(self, connect, collection):
|
||||
'''
|
||||
target: test insert entities, with less fields than collection schema
|
||||
|
@ -460,7 +460,7 @@ class TestInsertBase:
|
|||
with pytest.raises(Exception):
|
||||
connect.insert(collection, tmp_entity)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_with_field_vector_less(self, connect, collection):
|
||||
'''
|
||||
target: test insert entities, with less fields than collection schema
|
||||
|
@ -471,7 +471,7 @@ class TestInsertBase:
|
|||
with pytest.raises(Exception):
|
||||
connect.insert(collection, tmp_entity)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_with_no_field_vector_value(self, connect, collection):
|
||||
'''
|
||||
target: test insert entities, with no vector field value
|
||||
|
@ -483,7 +483,7 @@ class TestInsertBase:
|
|||
with pytest.raises(Exception):
|
||||
connect.insert(collection, tmp_entity)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_with_no_field_vector_type(self, connect, collection):
|
||||
'''
|
||||
target: test insert entities, with no vector field type
|
||||
|
@ -495,7 +495,7 @@ class TestInsertBase:
|
|||
with pytest.raises(Exception):
|
||||
connect.insert(collection, tmp_entity)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_with_no_field_vector_name(self, connect, collection):
|
||||
'''
|
||||
target: test insert entities, with no vector field name
|
||||
|
@ -562,7 +562,7 @@ class TestInsertBinary:
|
|||
request.param["metric_type"] = "JACCARD"
|
||||
return request.param
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_binary_entities(self, connect, binary_collection):
|
||||
'''
|
||||
target: test insert entities in binary collection
|
||||
|
@ -575,7 +575,7 @@ class TestInsertBinary:
|
|||
stats = connect.get_collection_stats(binary_collection)
|
||||
assert stats[row_count] == default_nb
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_binary_partition(self, connect, binary_collection):
|
||||
'''
|
||||
target: test insert entities and create partition tag
|
||||
|
@ -604,7 +604,7 @@ class TestInsertBinary:
|
|||
stats = connect.get_collection_stats(binary_collection)
|
||||
assert stats[row_count] == default_nb
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_binary_after_create_index(self, connect, binary_collection, get_binary_index):
|
||||
'''
|
||||
target: test insert binary entities after build index
|
||||
|
@ -633,7 +633,7 @@ class TestInsertBinary:
|
|||
index = connect.describe_index(binary_collection, binary_field_name)
|
||||
assert index == get_binary_index
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_binary_search(self, connect, binary_collection):
|
||||
'''
|
||||
target: test search vector after insert vector after a while
|
||||
|
@ -674,7 +674,7 @@ class TestInsertAsync:
|
|||
logging.getLogger().info("In callback check results")
|
||||
assert result
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_async(self, connect, collection, insert_count):
|
||||
'''
|
||||
target: test insert vectors with different length of vectors
|
||||
|
@ -701,7 +701,7 @@ class TestInsertAsync:
|
|||
connect.flush([collection])
|
||||
assert len(ids) == nb
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_async_callback(self, connect, collection, insert_count):
|
||||
'''
|
||||
target: test insert vectors with different length of vectors
|
||||
|
@ -746,7 +746,7 @@ class TestInsertAsync:
|
|||
stats = connect.get_collection_stats(collection)
|
||||
assert stats[row_count] == 0
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_async_invalid_params(self, connect):
|
||||
'''
|
||||
target: test insert vectors with different length of vectors
|
||||
|
@ -812,7 +812,7 @@ class TestInsertMultiCollections:
|
|||
assert stats[row_count] == default_nb
|
||||
|
||||
@pytest.mark.timeout(ADD_TIMEOUT)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_drop_collection_insert_entity_another(self, connect, collection):
|
||||
'''
|
||||
target: test insert vector to collection_1 after collection_2 deleted
|
||||
|
@ -827,7 +827,7 @@ class TestInsertMultiCollections:
|
|||
assert len(ids) == 1
|
||||
|
||||
@pytest.mark.timeout(ADD_TIMEOUT)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_create_index_insert_entity_another(self, connect, collection, get_simple_index):
|
||||
'''
|
||||
target: test insert vector to collection_2 after build index for collection_1
|
||||
|
@ -844,7 +844,7 @@ class TestInsertMultiCollections:
|
|||
connect.drop_collection(collection_name)
|
||||
|
||||
@pytest.mark.timeout(ADD_TIMEOUT)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_entity_create_index_another(self, connect, collection, get_simple_index):
|
||||
'''
|
||||
target: test insert vector to collection_2 after build index for collection_1
|
||||
|
@ -896,7 +896,7 @@ class TestInsertMultiCollections:
|
|||
assert stats[row_count] == 1
|
||||
|
||||
@pytest.mark.timeout(ADD_TIMEOUT)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_insert_entity_search_entity_another(self, connect, collection):
|
||||
'''
|
||||
target: test insert entity to collection_1 after search collection_2
|
||||
|
|
|
@ -145,7 +145,7 @@ class TestSearchBase:
|
|||
def get_nq(self, request):
|
||||
yield request.param
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_search_flat(self, connect, collection, get_top_k, get_nq):
|
||||
'''
|
||||
target: test basic search function, all the search params is correct, change top-k value
|
||||
|
@ -610,7 +610,7 @@ class TestSearchBase:
|
|||
with pytest.raises(Exception) as e:
|
||||
res = connect.search(collection_name, default_query)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_search_distance_l2(self, connect, collection):
|
||||
'''
|
||||
target: search collection, and check the result: distance
|
||||
|
@ -662,7 +662,7 @@ class TestSearchBase:
|
|||
# TODO:
|
||||
# assert abs(np.sqrt(res[0]._distances[0]) - min_distance) <= tmp_epsilon
|
||||
|
||||
# @pytest.mark.tags("0331")
|
||||
# @pytest.mark.tags("0331", "l1")
|
||||
@pytest.mark.level(2)
|
||||
def test_search_distance_ip(self, connect, collection):
|
||||
'''
|
||||
|
@ -719,7 +719,7 @@ class TestSearchBase:
|
|||
# TODO:
|
||||
# assert abs(res[0]._distances[0] - max_distance) <= tmp_epsilon
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_search_distance_jaccard_flat_index(self, connect, binary_collection):
|
||||
'''
|
||||
target: search binary_collection, and check the result: distance
|
||||
|
@ -1005,7 +1005,7 @@ class TestSearchDSL(object):
|
|||
with pytest.raises(Exception) as e:
|
||||
res = connect.search(collection, query)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_query_no_vector_term_only(self, connect, collection):
|
||||
'''
|
||||
method: build query without vector only term
|
||||
|
@ -1019,7 +1019,7 @@ class TestSearchDSL(object):
|
|||
with pytest.raises(Exception) as e:
|
||||
res = connect.search(collection, query)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_query_no_vector_range_only(self, connect, collection):
|
||||
'''
|
||||
method: build query without vector only range
|
||||
|
@ -1033,7 +1033,7 @@ class TestSearchDSL(object):
|
|||
with pytest.raises(Exception) as e:
|
||||
res = connect.search(collection, query)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_query_vector_only(self, connect, collection):
|
||||
entities, ids = init_data(connect, collection)
|
||||
connect.load_collection(collection)
|
||||
|
@ -1041,7 +1041,7 @@ class TestSearchDSL(object):
|
|||
assert len(res) == nq
|
||||
assert len(res[0]) == default_top_k
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_query_wrong_format(self, connect, collection):
|
||||
'''
|
||||
method: build query without must expr, with wrong expr name
|
||||
|
@ -1055,7 +1055,7 @@ class TestSearchDSL(object):
|
|||
with pytest.raises(Exception) as e:
|
||||
res = connect.search(collection, query)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_query_empty(self, connect, collection):
|
||||
'''
|
||||
method: search with empty query
|
||||
|
@ -1186,7 +1186,7 @@ class TestSearchDSL(object):
|
|||
assert len(res) == nq
|
||||
assert len(res[0]) == 0
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_query_complex_dsl(self, connect, collection):
|
||||
'''
|
||||
method: query with complicated dsl
|
||||
|
@ -1294,7 +1294,7 @@ class TestSearchDSL(object):
|
|||
"""
|
||||
|
||||
# TODO
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_query_range_key_error(self, connect, collection):
|
||||
'''
|
||||
method: build query with range key error
|
||||
|
@ -1381,7 +1381,7 @@ class TestSearchDSL(object):
|
|||
assert len(res) == nq
|
||||
assert len(res[0]) == default_top_k
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_query_range_one_field_not_existed(self, connect, collection):
|
||||
'''
|
||||
method: build query with two fields ranges, one of fields not existed
|
||||
|
@ -1620,7 +1620,7 @@ class TestSearchDSLBools(object):
|
|||
with pytest.raises(Exception) as e:
|
||||
res = connect.search(collection, query)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_query_should_only_term(self, connect, collection):
|
||||
'''
|
||||
method: build query without must, with should.term instead
|
||||
|
@ -1631,7 +1631,7 @@ class TestSearchDSLBools(object):
|
|||
with pytest.raises(Exception) as e:
|
||||
res = connect.search(collection, query)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_query_should_only_vector(self, connect, collection):
|
||||
'''
|
||||
method: build query without must, with should.vector instead
|
||||
|
@ -1742,7 +1742,7 @@ class TestSearchInvalid(object):
|
|||
res = connect.search(collection, default_query, fields=fields)
|
||||
|
||||
@pytest.mark.level(1)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_search_with_not_existed_field(self, connect, collection):
|
||||
fields = [gen_unique_str("field_name")]
|
||||
with pytest.raises(Exception) as e:
|
||||
|
@ -1760,7 +1760,7 @@ class TestSearchInvalid(object):
|
|||
yield request.param
|
||||
|
||||
@pytest.mark.level(1)
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_search_with_invalid_top_k(self, connect, collection, get_top_k):
|
||||
'''
|
||||
target: test search function, with the wrong top_k
|
||||
|
|
|
@ -49,7 +49,7 @@ class TestFlushBase:
|
|||
def get_vector_field(self, request):
|
||||
yield request.param
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_flush_collection_not_existed(self, connect, collection):
|
||||
'''
|
||||
target: test flush, params collection_name not existed
|
||||
|
@ -65,7 +65,7 @@ class TestFlushBase:
|
|||
message = getattr(e, 'message', "The exception does not contain the field of message.")
|
||||
assert message == "describe collection failed: can't find collection: %s" % collection_new
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_flush_empty_collection(self, connect, collection):
|
||||
'''
|
||||
method: flush collection with no vectors
|
||||
|
@ -101,7 +101,7 @@ class TestFlushBase:
|
|||
res_count = connect.get_collection_stats(id_collection)
|
||||
assert res_count["row_count"] == default_nb * 2
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_add_partitions_flush(self, connect, id_collection):
|
||||
'''
|
||||
method: add entities into partitions in collection, flush one
|
||||
|
@ -118,7 +118,7 @@ class TestFlushBase:
|
|||
res = connect.get_collection_stats(id_collection)
|
||||
assert res["row_count"] == 2 * default_nb
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_add_collections_flush(self, connect, id_collection):
|
||||
'''
|
||||
method: add entities into collections, flush one
|
||||
|
@ -174,7 +174,7 @@ class TestFlushBase:
|
|||
assert res["row_count"] == nb_new
|
||||
|
||||
# TODO ci failed
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_add_flush_multiable_times(self, connect, collection):
|
||||
'''
|
||||
method: add entities, flush serveral times
|
||||
|
@ -223,7 +223,7 @@ class TestFlushBase:
|
|||
def same_ids(self, request):
|
||||
yield request.param
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_add_flush_same_ids(self, connect, id_collection, same_ids):
|
||||
'''
|
||||
method: add entities, with same ids, count(same ids) < 15, > 15
|
||||
|
@ -238,7 +238,7 @@ class TestFlushBase:
|
|||
res = connect.get_collection_stats(id_collection)
|
||||
assert res["row_count"] == default_nb
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_delete_flush_multiable_times(self, connect, collection):
|
||||
'''
|
||||
method: delete entities, flush serveral times
|
||||
|
@ -347,7 +347,7 @@ class TestFlushAsync:
|
|||
status = future.result()
|
||||
assert status is None
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_flush_async_long_drop_collection(self, connect, collection):
|
||||
for i in range(5):
|
||||
ids = connect.insert(collection, default_entities)
|
||||
|
@ -358,7 +358,7 @@ class TestFlushAsync:
|
|||
res = connect.drop_collection(collection)
|
||||
assert res is None
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_flush_async(self, connect, collection):
|
||||
connect.insert(collection, default_entities)
|
||||
logging.getLogger().info("before")
|
||||
|
@ -391,7 +391,7 @@ class TestCollectionNameInvalid(object):
|
|||
with pytest.raises(Exception) as e:
|
||||
connect.flush(collection_name)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_flush_empty(self, connect, collection):
|
||||
ids = connect.insert(collection, default_entities)
|
||||
assert len(ids) == default_nb
|
||||
|
|
|
@ -47,7 +47,7 @@ class TestIndexBase:
|
|||
******************************************************************
|
||||
"""
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
@pytest.mark.timeout(BUILD_TIMEOUT)
|
||||
def test_create_index(self, connect, collection, get_simple_index):
|
||||
'''
|
||||
|
@ -60,7 +60,7 @@ class TestIndexBase:
|
|||
index = connect.describe_index(collection, field_name)
|
||||
assert index == get_simple_index
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_create_index_on_field_not_existed(self, connect, collection, get_simple_index):
|
||||
'''
|
||||
target: test create index interface
|
||||
|
@ -111,7 +111,7 @@ class TestIndexBase:
|
|||
index = connect.describe_index(collection, field_name)
|
||||
assert index == get_simple_index
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
@pytest.mark.timeout(BUILD_TIMEOUT)
|
||||
def test_create_index_partition_flush(self, connect, collection, get_simple_index):
|
||||
'''
|
||||
|
@ -136,7 +136,7 @@ class TestIndexBase:
|
|||
with pytest.raises(Exception) as e:
|
||||
dis_connect.create_index(collection, field_name, get_simple_index)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
@pytest.mark.timeout(BUILD_TIMEOUT)
|
||||
def test_create_index_search_with_query_vectors(self, connect, collection, get_simple_index, get_nq):
|
||||
'''
|
||||
|
@ -183,7 +183,7 @@ class TestIndexBase:
|
|||
for t in threads:
|
||||
t.join()
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_create_index_collection_not_existed(self, connect):
|
||||
'''
|
||||
target: test create index interface when collection name not existed
|
||||
|
@ -245,7 +245,7 @@ class TestIndexBase:
|
|||
index = connect.describe_index(collection, field_name)
|
||||
assert index == indexs[-1]
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
@pytest.mark.timeout(BUILD_TIMEOUT)
|
||||
def test_create_index_ip(self, connect, collection, get_simple_index):
|
||||
'''
|
||||
|
@ -259,7 +259,7 @@ class TestIndexBase:
|
|||
index = connect.describe_index(collection, field_name)
|
||||
assert index == get_simple_index
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
@pytest.mark.timeout(BUILD_TIMEOUT)
|
||||
def test_create_index_no_vectors_ip(self, connect, collection, get_simple_index):
|
||||
'''
|
||||
|
@ -287,7 +287,7 @@ class TestIndexBase:
|
|||
index = connect.describe_index(collection, field_name)
|
||||
assert index == get_simple_index
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
@pytest.mark.timeout(BUILD_TIMEOUT)
|
||||
def test_create_index_partition_flush_ip(self, connect, collection, get_simple_index):
|
||||
'''
|
||||
|
@ -303,7 +303,7 @@ class TestIndexBase:
|
|||
index = connect.describe_index(collection, field_name)
|
||||
assert index == get_simple_index
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
@pytest.mark.timeout(BUILD_TIMEOUT)
|
||||
def test_create_index_search_with_query_vectors_ip(self, connect, collection, get_simple_index, get_nq):
|
||||
'''
|
||||
|
@ -366,7 +366,7 @@ class TestIndexBase:
|
|||
with pytest.raises(Exception) as e:
|
||||
connect.create_index(collection_name, field_name, default_index)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
@pytest.mark.timeout(BUILD_TIMEOUT)
|
||||
def test_create_index_no_vectors_insert_ip(self, connect, collection):
|
||||
'''
|
||||
|
@ -426,7 +426,7 @@ class TestIndexBase:
|
|||
The following cases are used to test `drop_index` function
|
||||
******************************************************************
|
||||
"""
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_drop_index(self, connect, collection, get_simple_index):
|
||||
'''
|
||||
target: test drop index interface
|
||||
|
@ -464,7 +464,7 @@ class TestIndexBase:
|
|||
with pytest.raises(Exception) as e:
|
||||
dis_connect.drop_index(collection, field_name)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_drop_index_collection_not_existed(self, connect):
|
||||
'''
|
||||
target: test drop index interface when collection name not existed
|
||||
|
@ -476,7 +476,7 @@ class TestIndexBase:
|
|||
with pytest.raises(Exception) as e:
|
||||
connect.drop_index(collection_name, field_name)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_drop_index_collection_not_create(self, connect, collection):
|
||||
'''
|
||||
target: test drop index interface when index not created
|
||||
|
@ -630,7 +630,7 @@ class TestIndexBinary:
|
|||
binary_index = connect.describe_index(binary_collection, binary_field_name)
|
||||
assert binary_index == get_jaccard_index
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
@pytest.mark.timeout(BUILD_TIMEOUT)
|
||||
def test_create_index_partition(self, connect, binary_collection, get_jaccard_index):
|
||||
'''
|
||||
|
@ -644,7 +644,7 @@ class TestIndexBinary:
|
|||
binary_index = connect.describe_index(binary_collection, binary_field_name)
|
||||
assert binary_index == get_jaccard_index
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
@pytest.mark.timeout(BUILD_TIMEOUT)
|
||||
def test_create_index_search_with_query_vectors(self, connect, binary_collection, get_jaccard_index, get_nq):
|
||||
'''
|
||||
|
@ -744,7 +744,7 @@ class TestIndexBinary:
|
|||
binary_index = connect.describe_index(binary_collection, binary_field_name)
|
||||
assert not binary_index
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_drop_index_partition(self, connect, binary_collection, get_jaccard_index):
|
||||
'''
|
||||
target: test drop index interface
|
||||
|
@ -772,7 +772,7 @@ class TestIndexInvalid(object):
|
|||
def get_collection_name(self, request):
|
||||
yield request.param
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
@pytest.mark.level(1)
|
||||
def test_create_index_with_invalid_collection_name(self, connect, get_collection_name):
|
||||
collection_name = get_collection_name
|
||||
|
@ -849,7 +849,7 @@ class TestIndexAsync:
|
|||
# TODO:
|
||||
logging.getLogger().info(res)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
@pytest.mark.timeout(BUILD_TIMEOUT)
|
||||
def test_create_index_drop(self, connect, collection, get_simple_index):
|
||||
'''
|
||||
|
@ -871,7 +871,7 @@ class TestIndexAsync:
|
|||
future = connect.create_index(collection_name, field_name, default_index, _async=True)
|
||||
res = future.result()
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
@pytest.mark.timeout(BUILD_TIMEOUT)
|
||||
def test_create_index_callback(self, connect, collection, get_simple_index):
|
||||
'''
|
||||
|
|
|
@ -18,7 +18,7 @@ class TestCreateBase:
|
|||
******************************************************************
|
||||
"""
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_create_partition_a(self, connect, collection):
|
||||
'''
|
||||
target: test create partition, check status returned
|
||||
|
@ -58,7 +58,7 @@ class TestCreateBase:
|
|||
with pytest.raises(Exception) as e:
|
||||
connect.create_partition(collection, tag_tmp)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_create_partition_repeat(self, connect, collection):
|
||||
'''
|
||||
target: test create partition, check status returned
|
||||
|
@ -91,7 +91,7 @@ class TestCreateBase:
|
|||
message = getattr(e, 'message', "The exception does not contain the field of message.")
|
||||
assert message == "create partition failed: can't find collection: %s" % collection_name
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_create_partition_tag_name_None(self, connect, collection):
|
||||
'''
|
||||
target: test create partition, tag name set None, check status returned
|
||||
|
@ -104,7 +104,7 @@ class TestCreateBase:
|
|||
except Exception as e:
|
||||
assert e.args[0] == "`partition_tag` value None is illegal"
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_create_different_partition_tags(self, connect, collection):
|
||||
'''
|
||||
target: test create partition twice with different names
|
||||
|
@ -116,7 +116,7 @@ class TestCreateBase:
|
|||
connect.create_partition(collection, tag_name)
|
||||
assert compare_list_elements(connect.list_partitions(collection), [default_tag, tag_name, '_default'])
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_create_partition_insert_default(self, connect, id_collection):
|
||||
'''
|
||||
target: test create partition, and insert vectors, check status returned
|
||||
|
@ -128,7 +128,7 @@ class TestCreateBase:
|
|||
insert_ids = connect.insert(id_collection, default_entities, ids)
|
||||
assert len(insert_ids) == len(ids)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_create_partition_insert_with_tag(self, connect, id_collection):
|
||||
'''
|
||||
target: test create partition, and insert vectors, check status returned
|
||||
|
@ -140,7 +140,7 @@ class TestCreateBase:
|
|||
insert_ids = connect.insert(id_collection, default_entities, ids, partition_tag=default_tag)
|
||||
assert len(insert_ids) == len(ids)
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_create_partition_insert_with_tag_not_existed(self, connect, collection):
|
||||
'''
|
||||
target: test create partition, and insert vectors, check status returned
|
||||
|
@ -158,7 +158,7 @@ class TestCreateBase:
|
|||
message = getattr(e, 'message', "The exception does not contain the field of message.")
|
||||
assert message == "partitionID of partitionName:%s can not be find" % tag_new
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_create_partition_insert_same_tags(self, connect, id_collection):
|
||||
'''
|
||||
target: test create partition, and insert vectors, check status returned
|
||||
|
@ -207,7 +207,7 @@ class TestShowBase:
|
|||
******************************************************************
|
||||
"""
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_list_partitions(self, connect, collection):
|
||||
'''
|
||||
target: test show partitions, check status and partitions returned
|
||||
|
@ -217,7 +217,7 @@ class TestShowBase:
|
|||
connect.create_partition(collection, default_tag)
|
||||
assert compare_list_elements(connect.list_partitions(collection), [default_tag, '_default'])
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_list_partitions_no_partition(self, connect, collection):
|
||||
'''
|
||||
target: test show partitions with collection name, check status and partitions returned
|
||||
|
@ -227,7 +227,7 @@ class TestShowBase:
|
|||
res = connect.list_partitions(collection)
|
||||
assert compare_list_elements(res, ['_default'])
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_show_multi_partitions(self, connect, collection):
|
||||
'''
|
||||
target: test show partitions, check status and partitions returned
|
||||
|
@ -255,7 +255,7 @@ class TestHasBase:
|
|||
def get_tag_name(self, request):
|
||||
yield request.param
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_has_partition_a(self, connect, collection):
|
||||
'''
|
||||
target: test has_partition, check status and result
|
||||
|
@ -267,7 +267,7 @@ class TestHasBase:
|
|||
logging.getLogger().info(res)
|
||||
assert res
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_has_partition_multi_partitions(self, connect, collection):
|
||||
'''
|
||||
target: test has_partition, check status and result
|
||||
|
@ -280,7 +280,7 @@ class TestHasBase:
|
|||
res = connect.has_partition(collection, tag_name)
|
||||
assert res
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_has_partition_tag_not_existed(self, connect, collection):
|
||||
'''
|
||||
target: test has_partition, check status and result
|
||||
|
@ -291,7 +291,7 @@ class TestHasBase:
|
|||
logging.getLogger().info(res)
|
||||
assert not res
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_has_partition_collection_not_existed(self, connect, collection):
|
||||
'''
|
||||
target: test has_partition, check status and result
|
||||
|
@ -329,7 +329,7 @@ class TestDropBase:
|
|||
******************************************************************
|
||||
"""
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_drop_partition_a(self, connect, collection):
|
||||
'''
|
||||
target: test drop partition, check status and partition if existed
|
||||
|
@ -343,7 +343,7 @@ class TestDropBase:
|
|||
res2 = connect.list_partitions(collection)
|
||||
assert default_tag not in res2
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_drop_partition_tag_not_existed(self, connect, collection):
|
||||
'''
|
||||
target: test drop partition, but tag not existed
|
||||
|
@ -360,7 +360,7 @@ class TestDropBase:
|
|||
message = getattr(e, 'message', "The exception does not contain the field of message.")
|
||||
assert message == "DropPartition failed: partition %s does not exist" % new_tag
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_drop_partition_tag_not_existed_A(self, connect, collection):
|
||||
'''
|
||||
target: test drop partition, but collection not existed
|
||||
|
@ -377,7 +377,7 @@ class TestDropBase:
|
|||
message = getattr(e, 'message', "The exception does not contain the field of message.")
|
||||
assert message == "DropPartition failed: can't find collection: %s" % new_collection
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
@pytest.mark.level(2)
|
||||
def test_drop_partition_repeatedly(self, connect, collection):
|
||||
'''
|
||||
|
@ -398,7 +398,7 @@ class TestDropBase:
|
|||
tag_list = connect.list_partitions(collection)
|
||||
assert default_tag not in tag_list
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_drop_partition_create(self, connect, collection):
|
||||
'''
|
||||
target: test drop partition, and create again, check status
|
||||
|
@ -471,7 +471,7 @@ class TestNameInvalid(object):
|
|||
|
||||
class TestNewCase(object):
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_drop_default_partition_A(self, connect, collection):
|
||||
'''
|
||||
target: test drop partition of default, check status returned
|
||||
|
@ -488,7 +488,7 @@ class TestNewCase(object):
|
|||
list_partition = connect.list_partitions(collection)
|
||||
assert '_default' in list_partition
|
||||
|
||||
@pytest.mark.tags("0331")
|
||||
@pytest.mark.tags("0331", "l1")
|
||||
def test_drop_default_partition_B(self, connect, collection):
|
||||
'''
|
||||
target: test drop partition of default, check status returned
|
||||
|
|
Loading…
Reference in New Issue