Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
18a9b9ce
milvus
项目概览
BaiXuePrincess
/
milvus
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
18a9b9ce
编写于
11月 30, 2019
作者:
J
Jin Hai
提交者:
GitHub
11月 30, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #623 from del-zhenwu/0.6.0
Update build index timeout
上级
91b165d3
e4c7115b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
20 deletion
+21
-20
tests/milvus_python_test/test_index.py
tests/milvus_python_test/test_index.py
+19
-19
tests/milvus_python_test/test_table_count.py
tests/milvus_python_test/test_table_count.py
+2
-1
未找到文件。
tests/milvus_python_test/test_index.py
浏览文件 @
18a9b9ce
...
@@ -18,7 +18,7 @@ index_file_size = 10
...
@@ -18,7 +18,7 @@ index_file_size = 10
vectors
=
gen_vectors
(
nb
,
dim
)
vectors
=
gen_vectors
(
nb
,
dim
)
vectors
=
sklearn
.
preprocessing
.
normalize
(
vectors
,
axis
=
1
,
norm
=
'l2'
)
vectors
=
sklearn
.
preprocessing
.
normalize
(
vectors
,
axis
=
1
,
norm
=
'l2'
)
vectors
=
vectors
.
tolist
()
vectors
=
vectors
.
tolist
()
BUILD_TIMEOUT
=
6
0
BUILD_TIMEOUT
=
30
0
nprobe
=
1
nprobe
=
1
tag
=
"1970-01-01"
tag
=
"1970-01-01"
...
@@ -51,27 +51,27 @@ class TestIndexBase:
...
@@ -51,27 +51,27 @@ class TestIndexBase:
"""
"""
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index
(
self
,
connect
,
table
,
get_index_params
):
def
test_create_index
(
self
,
connect
,
table
,
get_
simple_
index_params
):
'''
'''
target: test create index interface
target: test create index interface
method: create table and add vectors in it, create index
method: create table and add vectors in it, create index
expected: return code equals to 0, and search success
expected: return code equals to 0, and search success
'''
'''
index_params
=
get_index_params
index_params
=
get_
simple_
index_params
logging
.
getLogger
().
info
(
index_params
)
logging
.
getLogger
().
info
(
index_params
)
status
,
ids
=
connect
.
add_vectors
(
table
,
vectors
)
status
,
ids
=
connect
.
add_vectors
(
table
,
vectors
)
status
=
connect
.
create_index
(
table
,
index_params
)
status
=
connect
.
create_index
(
table
,
index_params
)
assert
status
.
OK
()
assert
status
.
OK
()
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index_partition
(
self
,
connect
,
table
,
get_index_params
):
def
test_create_index_partition
(
self
,
connect
,
table
,
get_
simple_
index_params
):
'''
'''
target: test create index interface
target: test create index interface
method: create table, create partition, and add vectors in it, create index
method: create table, create partition, and add vectors in it, create index
expected: return code equals to 0, and search success
expected: return code equals to 0, and search success
'''
'''
partition_name
=
gen_unique_str
()
partition_name
=
gen_unique_str
()
index_params
=
get_index_params
index_params
=
get_
simple_
index_params
logging
.
getLogger
().
info
(
index_params
)
logging
.
getLogger
().
info
(
index_params
)
status
=
connect
.
create_partition
(
table
,
partition_name
,
tag
)
status
=
connect
.
create_partition
(
table
,
partition_name
,
tag
)
status
,
ids
=
connect
.
add_vectors
(
table
,
vectors
,
partition_tag
=
tag
)
status
,
ids
=
connect
.
add_vectors
(
table
,
vectors
,
partition_tag
=
tag
)
...
@@ -91,13 +91,13 @@ class TestIndexBase:
...
@@ -91,13 +91,13 @@ class TestIndexBase:
status
=
dis_connect
.
create_index
(
table
,
index_param
)
status
=
dis_connect
.
create_index
(
table
,
index_param
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index_search_with_query_vectors
(
self
,
connect
,
table
,
get_index_params
):
def
test_create_index_search_with_query_vectors
(
self
,
connect
,
table
,
get_
simple_
index_params
):
'''
'''
target: test create index interface, search with more query vectors
target: test create index interface, search with more query vectors
method: create table and add vectors in it, create index
method: create table and add vectors in it, create index
expected: return code equals to 0, and search success
expected: return code equals to 0, and search success
'''
'''
index_params
=
get_index_params
index_params
=
get_
simple_
index_params
logging
.
getLogger
().
info
(
index_params
)
logging
.
getLogger
().
info
(
index_params
)
status
,
ids
=
connect
.
add_vectors
(
table
,
vectors
)
status
,
ids
=
connect
.
add_vectors
(
table
,
vectors
)
status
=
connect
.
create_index
(
table
,
index_params
)
status
=
connect
.
create_index
(
table
,
index_params
)
...
@@ -291,13 +291,13 @@ class TestIndexBase:
...
@@ -291,13 +291,13 @@ class TestIndexBase:
******************************************************************
******************************************************************
"""
"""
def
test_describe_index
(
self
,
connect
,
table
,
get_index_params
):
def
test_describe_index
(
self
,
connect
,
table
,
get_
simple_
index_params
):
'''
'''
target: test describe index interface
target: test describe index interface
method: create table and add vectors in it, create index, call describe index
method: create table and add vectors in it, create index, call describe index
expected: return code 0, and index instructure
expected: return code 0, and index instructure
'''
'''
index_params
=
get_index_params
index_params
=
get_
simple_
index_params
logging
.
getLogger
().
info
(
index_params
)
logging
.
getLogger
().
info
(
index_params
)
status
,
ids
=
connect
.
add_vectors
(
table
,
vectors
)
status
,
ids
=
connect
.
add_vectors
(
table
,
vectors
)
status
=
connect
.
create_index
(
table
,
index_params
)
status
=
connect
.
create_index
(
table
,
index_params
)
...
@@ -398,13 +398,13 @@ class TestIndexBase:
...
@@ -398,13 +398,13 @@ class TestIndexBase:
******************************************************************
******************************************************************
"""
"""
def
test_drop_index
(
self
,
connect
,
table
,
get_index_params
):
def
test_drop_index
(
self
,
connect
,
table
,
get_
simple_
index_params
):
'''
'''
target: test drop index interface
target: test drop index interface
method: create table and add vectors in it, create index, call drop index
method: create table and add vectors in it, create index, call drop index
expected: return code 0, and default index param
expected: return code 0, and default index param
'''
'''
index_param
=
get_index_params
index_param
=
get_
simple_
index_params
status
,
ids
=
connect
.
add_vectors
(
table
,
vectors
)
status
,
ids
=
connect
.
add_vectors
(
table
,
vectors
)
status
=
connect
.
create_index
(
table
,
index_param
)
status
=
connect
.
create_index
(
table
,
index_param
)
assert
status
.
OK
()
assert
status
.
OK
()
...
@@ -418,13 +418,13 @@ class TestIndexBase:
...
@@ -418,13 +418,13 @@ class TestIndexBase:
assert
result
.
_table_name
==
table
assert
result
.
_table_name
==
table
assert
result
.
_index_type
==
IndexType
.
FLAT
assert
result
.
_index_type
==
IndexType
.
FLAT
def
test_drop_index_repeatly
(
self
,
connect
,
table
,
get_index_params
):
def
test_drop_index_repeatly
(
self
,
connect
,
table
,
get_
simple_
index_params
):
'''
'''
target: test drop index repeatly
target: test drop index repeatly
method: create index, call drop index, and drop again
method: create index, call drop index, and drop again
expected: return code 0
expected: return code 0
'''
'''
index_param
=
get_index_params
index_param
=
get_
simple_
index_params
status
,
ids
=
connect
.
add_vectors
(
table
,
vectors
)
status
,
ids
=
connect
.
add_vectors
(
table
,
vectors
)
status
=
connect
.
create_index
(
table
,
index_param
)
status
=
connect
.
create_index
(
table
,
index_param
)
assert
status
.
OK
()
assert
status
.
OK
()
...
@@ -560,13 +560,13 @@ class TestIndexIP:
...
@@ -560,13 +560,13 @@ class TestIndexIP:
"""
"""
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index
(
self
,
connect
,
ip_table
,
get_index_params
):
def
test_create_index
(
self
,
connect
,
ip_table
,
get_
simple_
index_params
):
'''
'''
target: test create index interface
target: test create index interface
method: create table and add vectors in it, create index
method: create table and add vectors in it, create index
expected: return code equals to 0, and search success
expected: return code equals to 0, and search success
'''
'''
index_params
=
get_index_params
index_params
=
get_
simple_
index_params
logging
.
getLogger
().
info
(
index_params
)
logging
.
getLogger
().
info
(
index_params
)
status
,
ids
=
connect
.
add_vectors
(
ip_table
,
vectors
)
status
,
ids
=
connect
.
add_vectors
(
ip_table
,
vectors
)
status
=
connect
.
create_index
(
ip_table
,
index_params
)
status
=
connect
.
create_index
(
ip_table
,
index_params
)
...
@@ -576,14 +576,14 @@ class TestIndexIP:
...
@@ -576,14 +576,14 @@ class TestIndexIP:
assert
status
.
OK
()
assert
status
.
OK
()
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index_partition
(
self
,
connect
,
ip_table
,
get_index_params
):
def
test_create_index_partition
(
self
,
connect
,
ip_table
,
get_
simple_
index_params
):
'''
'''
target: test create index interface
target: test create index interface
method: create table, create partition, and add vectors in it, create index
method: create table, create partition, and add vectors in it, create index
expected: return code equals to 0, and search success
expected: return code equals to 0, and search success
'''
'''
partition_name
=
gen_unique_str
()
partition_name
=
gen_unique_str
()
index_params
=
get_index_params
index_params
=
get_
simple_
index_params
logging
.
getLogger
().
info
(
index_params
)
logging
.
getLogger
().
info
(
index_params
)
status
=
connect
.
create_partition
(
ip_table
,
partition_name
,
tag
)
status
=
connect
.
create_partition
(
ip_table
,
partition_name
,
tag
)
status
,
ids
=
connect
.
add_vectors
(
ip_table
,
vectors
,
partition_tag
=
tag
)
status
,
ids
=
connect
.
add_vectors
(
ip_table
,
vectors
,
partition_tag
=
tag
)
...
@@ -606,13 +606,13 @@ class TestIndexIP:
...
@@ -606,13 +606,13 @@ class TestIndexIP:
status
=
dis_connect
.
create_index
(
ip_table
,
index_param
)
status
=
dis_connect
.
create_index
(
ip_table
,
index_param
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index_search_with_query_vectors
(
self
,
connect
,
ip_table
,
get_index_params
):
def
test_create_index_search_with_query_vectors
(
self
,
connect
,
ip_table
,
get_
simple_
index_params
):
'''
'''
target: test create index interface, search with more query vectors
target: test create index interface, search with more query vectors
method: create table and add vectors in it, create index
method: create table and add vectors in it, create index
expected: return code equals to 0, and search success
expected: return code equals to 0, and search success
'''
'''
index_params
=
get_index_params
index_params
=
get_
simple_
index_params
logging
.
getLogger
().
info
(
index_params
)
logging
.
getLogger
().
info
(
index_params
)
status
,
ids
=
connect
.
add_vectors
(
ip_table
,
vectors
)
status
,
ids
=
connect
.
add_vectors
(
ip_table
,
vectors
)
status
=
connect
.
create_index
(
ip_table
,
index_params
)
status
=
connect
.
create_index
(
ip_table
,
index_params
)
...
...
tests/milvus_python_test/test_table_count.py
浏览文件 @
18a9b9ce
...
@@ -327,8 +327,9 @@ class TestTableCountIP:
...
@@ -327,8 +327,9 @@ class TestTableCountIP:
status
,
res
=
connect
.
get_table_row_count
(
ip_table
)
status
,
res
=
connect
.
get_table_row_count
(
ip_table
)
assert
res
==
0
assert
res
==
0
# TODO: enable
@
pytest
.
mark
.
timeout
(
60
)
@
pytest
.
mark
.
timeout
(
60
)
def
test_table_rows_count_multiprocessing
(
self
,
connect
,
ip_table
,
args
):
def
_
test_table_rows_count_multiprocessing
(
self
,
connect
,
ip_table
,
args
):
'''
'''
target: test table rows_count is correct or not with multiprocess
target: test table rows_count is correct or not with multiprocess
method: create table and add vectors in it,
method: create table and add vectors in it,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录