common_type.py 4.1 KB
Newer Older
紫晴 已提交
1 2 3 4 5 6 7 8 9

""" Initialized parameters """
port = 19530
epsilon = 0.000001
namespace = "milvus"
default_flush_interval = 1
big_flush_interval = 1000
default_drop_interval = 3
default_dim = 128
10
default_nb = 1200
紫晴 已提交
11
default_top_k = 10
12 13 14
default_nq = 2
default_limit = 10
default_search_params = {"metric_type": "L2", "params": {"nprobe": 10}}
紫晴 已提交
15 16 17 18
max_top_k = 16384
max_partition_num = 4096  # 256
default_segment_row_limit = 1000
default_server_segment_row_limit = 1024 * 512
T
ThreadDao 已提交
19
default_alias = "default"
20 21 22 23
default_bool_field_name = "bool"
default_int8_field_name = "int8"
default_int16_field_name = "int16"
default_int32_field_name = "int32"
Y
yanliang567 已提交
24 25
default_int64_field_name = "int64"
default_float_field_name = "float"
26
default_double_field_name = "double"
紫晴 已提交
27 28 29 30 31
default_float_vec_field_name = "float_vector"
default_binary_vec_field_name = "binary_vector"
default_partition_name = "_default"
default_tag = "1970_01_01"
row_count = "row_count"
32
default_desc = ""
33
default_collection_desc = "default collection"
D
del-zhenwu 已提交
34
default_index_name = "default_index_name"
35 36 37 38 39 40
default_binary_desc = "default binary collection"
collection_desc = "collection"
int_field_desc = "int64 type field"
float_field_desc = "float type field"
float_vec_field_desc = "float vector type field"
binary_vec_field_desc = "binary vector type field"
紫晴 已提交
41

紫晴 已提交
42
Not_Exist = "Not_Exist"
43
Connect_Object_Name = "Milvus"
44 45 46
list_content = "list_content"
dict_content = "dict_content"
value_content = "value_content"
47

48 49
err_code = "err_code"
err_msg = "err_msg"
紫晴 已提交
50 51

"""" List of parameters used to pass """
T
ThreadDao 已提交
52 53 54 55 56 57 58 59 60 61 62 63 64
get_invalid_strs = [
    [],
    1,
    [1, "2", 3],
    (1,),
    {1: 1},
    None,
    "12-s",
    "12 s",
    "(mn)",
    "中文",
    "%$#",
    "a".join("a" for i in range(256))]
紫晴 已提交
65

66 67 68 69 70 71 72 73 74 75 76 77 78 79
get_dict_without_host_port = [
    {"host": "host"},
    {"port": "port"},
    # ["host", "port"],
    # ("host", "port"),
    {"host": -1},
    {"port": ["192.168.1.1"]},
    {"": ""}
]

get_wrong_format_dict = [
    {"host": "string_host", "port": {}},
    {"host": 0, "port": 19520}
]
紫晴 已提交
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99

""" Specially defined list """
all_index_types = ["FLAT", "IVF_FLAT", "IVF_SQ8", "IVF_PQ", "HNSW", "ANNOY", "RHNSW_FLAT", "RHNSW_PQ", "RHNSW_SQ",
                   "BIN_FLAT", "BIN_IVF_FLAT"]

default_index_params = [{"nlist": 128}, {"nlist": 128}, {"nlist": 128}, {"nlist": 128, "m": 16, "nbits": 8},
                        {"M": 48, "efConstruction": 500}, {"n_trees": 50}, {"M": 48, "efConstruction": 500},
                        {"M": 48, "efConstruction": 500, "PQM": 64}, {"M": 48, "efConstruction": 500}, {"nlist": 128},
                        {"nlist": 128}]

Handler_type = ["GRPC", "HTTP"]
index_cpu_not_support = ["IVF_SQ8_HYBRID"]
binary_support = ["BIN_FLAT", "BIN_IVF_FLAT"]
delete_support = ["FLAT", "IVF_FLAT", "IVF_SQ8", "IVF_SQ8_HYBRID", "IVF_PQ"]
ivf = ["FLAT", "IVF_FLAT", "IVF_SQ8", "IVF_SQ8_HYBRID", "IVF_PQ"]
skip_pq = ["IVF_PQ", "RHNSW_PQ", "RHNSW_SQ"]
binary_metrics = ["JACCARD", "HAMMING", "TANIMOTO", "SUBSTRUCTURE", "SUPERSTRUCTURE"]
structure_metrics = ["SUBSTRUCTURE", "SUPERSTRUCTURE"]


Y
yanliang567 已提交
100
class CheckTasks:
紫晴 已提交
101
    """ The name of the method used to check the result """
紫晴 已提交
102
    false = False
103
    err_res = "error_response"
104
    ccr = "check_connection_result"
Y
yanliang567 已提交
105 106
    check_collection_property = "check_collection_property"
    check_partition_property = "check_partition_property"
B
binbin 已提交
107
    check_search_results = "check_search_results"
T
ThreadDao 已提交
108
    check_query_results = "check_query_results"
紫晴 已提交
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138


class CaseLabel:
    """
    Testcase Levels
    CI Regression:
        L0:
            part of CI Regression
            triggered by github commit
            optional used for dev to verify his fix before submitting a PR(like smoke)
            ~100 testcases and run in 3 mins
        L1:
            part of CI Regression
            triggered by github commit
            must pass before merge
            run in 15 mins
    Benchmark:
        L2:
            E2E tests and bug-fix verification
            Nightly run triggered by cron job
            run in 60 mins
        L3:
            Stability/Performance/reliability, etc. special tests
            Triggered by cron job or manually
            run duration depends on test configuration
    """
    L0 = "L0"
    L1 = "L1"
    L2 = "L2"
    L3 = "L3"