Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
5e9110c8
M
milvus
项目概览
milvus
/
milvus
11 个月 前同步成功
通知
261
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
5e9110c8
编写于
8月 13, 2021
作者:
B
binbin
提交者:
GitHub
8月 13, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Disable test cases (#7087)
Signed-off-by:
N
Binbin Lv
<
binbin.lv@zilliz.com
>
上级
86ca96a0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
62 addition
and
8 deletion
+62
-8
tests20/python_client/testcases/test_search.py
tests20/python_client/testcases/test_search.py
+1
-0
tests20/python_client/testcases/test_utility.py
tests20/python_client/testcases/test_utility.py
+61
-8
未找到文件。
tests20/python_client/testcases/test_search.py
浏览文件 @
5e9110c8
...
...
@@ -1470,6 +1470,7 @@ class TestCollectionSearch(TestcaseBase):
assert
abs
(
res
[
0
].
_distances
[
0
]
-
min
(
distance_0
,
distance_1
))
<=
epsilon
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
xfail
(
reason
=
"issue 6843"
)
def
test_search_binary_tanimoto_flat_index
(
self
,
nq
,
dim
,
auto_id
,
_async
):
"""
target: search binary_collection, and check the result: distance
...
...
tests20/python_client/testcases/test_utility.py
浏览文件 @
5e9110c8
...
...
@@ -18,6 +18,17 @@ default_nb = ct.default_nb
class
TestUtilityParams
(
TestcaseBase
):
""" Test case of index interface """
@
pytest
.
fixture
(
scope
=
"function"
,
params
=
ct
.
get_invalid_strs
)
def
get_invalid_metric_type
(
self
,
request
):
if
request
.
param
==
[]
or
request
.
param
==
""
:
pytest
.
skip
(
"metric empty is valid for distance calculation"
)
yield
request
.
param
"""
******************************************************************
# The followings are invalid cases
******************************************************************
"""
@
pytest
.
mark
.
tags
(
CaseLabel
.
L1
)
def
test_has_collection_name_invalid
(
self
,
get_invalid_collection_name
):
"""
...
...
@@ -207,6 +218,26 @@ class TestUtilityParams(TestcaseBase):
"err_msg"
:
"Cannot calculate distance between "
"vectors with different dimension"
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
xfail
(
reason
=
"issue 7086"
)
def
test_calc_distance_invalid_metric
(
self
,
get_invalid_metric_type
):
"""
target: test calculated distance with invalid metric
method: input invalid metric
expected: raise exception
"""
self
.
_connect
()
vectors_l
=
cf
.
gen_vectors
(
default_nb
,
default_dim
)
vectors_r
=
cf
.
gen_vectors
(
default_nb
,
default_dim
)
op_l
=
{
"float_vectors"
:
vectors_l
}
op_r
=
{
"float_vectors"
:
vectors_r
}
metric
=
get_invalid_metric_type
params
=
{
"metric"
:
metric
}
self
.
utility_wrap
.
calc_distance
(
op_l
,
op_r
,
params
,
check_task
=
CheckTasks
.
err_res
,
check_items
=
{
"err_code"
:
1
,
"err_msg"
:
"Invalid metric type"
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_calc_distance_invalid_using
(
self
):
"""
...
...
@@ -215,8 +246,8 @@ class TestUtilityParams(TestcaseBase):
expected: raise exception
"""
self
.
_connect
()
vectors_l
=
cf
.
gen_vectors
(
5
,
64
)
vectors_r
=
cf
.
gen_vectors
(
10
,
64
)
vectors_l
=
cf
.
gen_vectors
(
default_nb
,
default_dim
)
vectors_r
=
cf
.
gen_vectors
(
default_nb
,
default_dim
)
op_l
=
{
"float_vectors"
:
vectors_l
}
op_r
=
{
"float_vectors"
:
vectors_r
}
params
=
{
"metric"
:
"L2"
,
"sqrt"
:
True
}
...
...
@@ -239,12 +270,34 @@ class TestUtilityParams(TestcaseBase):
vector_r
=
cf
.
gen_vectors
(
default_nb
,
dim
)
op_l
=
{
"float_vectors"
:
vector_l
}
op_r
=
{
"float_vectors"
:
vector_r
}
ut
=
ApiUtilityWrapper
()
ut
.
calc_distance
(
op_l
,
op_r
,
check_task
=
CheckTasks
.
err_res
,
check_items
=
{
"err_code"
:
1
,
"err_msg"
:
"Cannot calculate distance between "
"vectors with different dimension"
})
self
.
utility_wrap
.
calc_distance
(
op_l
,
op_r
,
check_task
=
CheckTasks
.
err_res
,
check_items
=
{
"err_code"
:
1
,
"err_msg"
:
"Cannot calculate distance between "
"vectors with different dimension"
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
xfail
(
reason
=
"issue 7036"
)
def
test_calc_distance_collection_before_load
(
self
):
"""
target: test calculated distance when entities is not ready
method: calculate distance before load
expected: raise exception
"""
self
.
_connect
()
nb
=
10
collection_w
,
vectors
,
_
,
insert_ids
=
self
.
init_collection_general
(
prefix
,
True
,
nb
,
is_index
=
True
)
middle
=
len
(
insert_ids
)
//
2
op_l
=
{
"ids"
:
insert_ids
[:
middle
],
"collection"
:
collection_w
.
name
,
"field"
:
default_field_name
}
op_r
=
{
"ids"
:
insert_ids
[
middle
:],
"collection"
:
collection_w
.
name
,
"field"
:
default_field_name
}
params
=
{
"metric"
:
"L2"
,
"sqrt"
:
True
}
self
.
utility_wrap
.
calc_distance
(
op_l
,
op_r
,
params
,
check_task
=
CheckTasks
.
err_res
,
check_items
=
{
"err_code"
:
1
,
"err_msg"
:
"Failed to fetch vectors"
})
class
TestUtilityBase
(
TestcaseBase
):
""" Test case of index interface """
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录