Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
a8f7dc86
M
milvus
项目概览
milvus
/
milvus
11 个月 前同步成功
通知
260
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
a8f7dc86
编写于
8月 27, 2021
作者:
B
binbin
提交者:
GitHub
8月 27, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update test cases after code change and fix (#7314)
Signed-off-by:
N
Binbin Lv
<
binbin.lv@zilliz.com
>
上级
7c60e6aa
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
58 addition
and
44 deletion
+58
-44
build/ci/jenkins/Jenkinsfile
build/ci/jenkins/Jenkinsfile
+1
-1
build/ci/jenkins/NightlyCI.groovy
build/ci/jenkins/NightlyCI.groovy
+3
-2
tests/python_client/requirements.txt
tests/python_client/requirements.txt
+1
-1
tests/python_client/testcases/test_utility_20.py
tests/python_client/testcases/test_utility_20.py
+53
-40
未找到文件。
build/ci/jenkins/Jenkinsfile
浏览文件 @
a8f7dc86
...
...
@@ -101,7 +101,7 @@ pipeline {
sh
"./tests/scripts/export_logs.sh"
dir
(
"${env.ARTIFACTS}"
)
{
sh
"find ./kind -path '*/history/*' -type f | xargs tar -zcvf artifacts-${PROJECT_NAME}-${MILVUS_SERVER_TYPE}-${SEMVER}-${env.BUILD_NUMBER}-${MILVUS_CLIENT}-e2e-logs.tar.gz --transform='s:^[^/]*/[^/]*/[^/]*/[^/]*/::g' || true"
if
(
"${MILVUS_CLIENT}"
==
"pymilvus
-orm
"
)
{
if
(
"${MILVUS_CLIENT}"
==
"pymilvus"
)
{
sh
"tar -zcvf artifacts-${PROJECT_NAME}-${MILVUS_SERVER_TYPE}-${MILVUS_CLIENT}-pytest-logs.tar.gz ./tests/pytest_logs --remove-files || true"
}
archiveArtifacts
artifacts:
"**.tar.gz"
,
allowEmptyArchive:
true
...
...
build/ci/jenkins/NightlyCI.groovy
浏览文件 @
a8f7dc86
...
...
@@ -5,7 +5,7 @@
String
cron_timezone
=
"TZ=Asia/Shanghai"
String
cron_string
=
BRANCH_NAME
==
"master"
?
"50 22 * * * "
:
""
int
total_timeout_minutes
=
3
0
0
int
total_timeout_minutes
=
3
6
0
int
e2e_timeout_seconds
=
4
*
60
*
60
pipeline
{
...
...
@@ -67,6 +67,7 @@ pipeline {
def
clusterEnabled
=
"false"
if
(
"${MILVUS_SERVER_TYPE}"
==
"distributed"
)
{
clusterEnabled
=
"true"
e2e_timeout_seconds
=
5
*
60
*
60
}
if
(
"${MILVUS_CLIENT}"
==
"pymilvus"
)
{
...
...
@@ -139,7 +140,7 @@ pipeline {
sh
"./tests/scripts/export_logs.sh"
dir
(
"${env.ARTIFACTS}"
)
{
sh
"find ./kind -path '*/history/*' -type f | xargs tar -zcvf artifacts-${PROJECT_NAME}-${MILVUS_SERVER_TYPE}-${SEMVER}-${env.BUILD_NUMBER}-e2e-nightly-logs.tar.gz --transform='s:^[^/]*/[^/]*/[^/]*/[^/]*/::g' || true"
if
(
"${MILVUS_CLIENT}"
==
"pymilvus
-orm
"
)
{
if
(
"${MILVUS_CLIENT}"
==
"pymilvus"
)
{
sh
"tar -zcvf artifacts-${PROJECT_NAME}-${MILVUS_SERVER_TYPE}-${MILVUS_CLIENT}-pytest-logs.tar.gz ./tests/pytest_logs --remove-files || true"
}
archiveArtifacts
artifacts:
"**.tar.gz"
,
allowEmptyArchive:
true
...
...
tests/python_client/requirements.txt
浏览文件 @
a8f7dc86
...
...
@@ -12,7 +12,7 @@ pytest-print==0.2.1
pytest-level==0.1.1
pytest-xdist==2.2.1
# pytest-parallel
pymilvus==2.0.0rc5.dev2
0
pymilvus==2.0.0rc5.dev2
9
pytest-rerunfailures==9.1.1
git+https://github.com/Projectplace/pytest-tags
ndg-httpsclient
...
...
tests/python_client/testcases/test_utility_20.py
浏览文件 @
a8f7dc86
...
...
@@ -38,6 +38,10 @@ class TestUtilityParams(TestcaseBase):
def
get_not_support_metric
(
self
,
request
):
yield
request
.
param
@
pytest
.
fixture
(
scope
=
"function"
,
params
=
[
"metric_type"
,
"metric"
])
def
get_support_metric_field
(
self
,
request
):
yield
request
.
param
"""
******************************************************************
# The followings are invalid cases
...
...
@@ -183,7 +187,6 @@ class TestUtilityParams(TestcaseBase):
"is illegal"
.
format
(
invalid_vector
)})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L1
)
@
pytest
.
mark
.
xfail
(
reason
=
"issue 7038"
)
def
test_calc_distance_left_vector_invalid_value
(
self
,
get_invalid_vector_dict
):
"""
target: test calculated distance with invalid vectors
...
...
@@ -196,7 +199,8 @@ class TestUtilityParams(TestcaseBase):
self
.
utility_wrap
.
calc_distance
(
invalid_vector
,
invalid_vector
,
check_task
=
CheckTasks
.
err_res
,
check_items
=
{
"err_code"
:
1
,
"err_msg"
:
"Left vectors array is empty"
})
"err_msg"
:
"vectors_left value {} "
"is illegal"
.
format
(
invalid_vector
)})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L1
)
def
test_calc_distance_right_vector_invalid_type
(
self
,
get_invalid_vector_dict
):
...
...
@@ -217,7 +221,6 @@ class TestUtilityParams(TestcaseBase):
"is illegal"
.
format
(
invalid_vector
)})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L1
)
@
pytest
.
mark
.
xfail
(
reason
=
"issue 7038"
)
def
test_calc_distance_right_vector_invalid_value
(
self
,
get_invalid_vector_dict
):
"""
target: test calculated distance with invalid vectors
...
...
@@ -232,11 +235,11 @@ class TestUtilityParams(TestcaseBase):
self
.
utility_wrap
.
calc_distance
(
op_l
,
invalid_vector
,
check_task
=
CheckTasks
.
err_res
,
check_items
=
{
"err_code"
:
1
,
"err_msg"
:
"
Cannot calculate distance between
"
"
vectors with different dimension"
})
"err_msg"
:
"
vectors_right value {}
"
"
is illegal"
.
format
(
invalid_vector
)
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_calc_distance_invalid_metric_type
(
self
,
get_invalid_metric_type
):
def
test_calc_distance_invalid_metric_type
(
self
,
get_
support_metric_field
,
get_
invalid_metric_type
):
"""
target: test calculated distance with invalid metric
method: input invalid metric
...
...
@@ -247,16 +250,17 @@ class TestUtilityParams(TestcaseBase):
vectors_r
=
cf
.
gen_vectors
(
default_nb
,
default_dim
)
op_l
=
{
"float_vectors"
:
vectors_l
}
op_r
=
{
"float_vectors"
:
vectors_r
}
metric_field
=
get_support_metric_field
metric
=
get_invalid_metric_type
params
=
{
"metric"
:
metric
}
params
=
{
metric_field
:
metric
}
self
.
utility_wrap
.
calc_distance
(
op_l
,
op_r
,
params
,
check_task
=
CheckTasks
.
err_res
,
check_items
=
{
"err_code"
:
1
,
"err_msg"
:
"params value {} "
"is illegal"
.
format
(
params
)})
"err_msg"
:
"params value {
{'metric': {}}
} "
"is illegal"
.
format
(
metric
)})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_calc_distance_invalid_metric_value
(
self
,
get_invalid_metric_value
):
def
test_calc_distance_invalid_metric_value
(
self
,
get_
support_metric_field
,
get_
invalid_metric_value
):
"""
target: test calculated distance with invalid metric
method: input invalid metric
...
...
@@ -267,15 +271,17 @@ class TestUtilityParams(TestcaseBase):
vectors_r
=
cf
.
gen_vectors
(
default_nb
,
default_dim
)
op_l
=
{
"float_vectors"
:
vectors_l
}
op_r
=
{
"float_vectors"
:
vectors_r
}
metric_field
=
get_support_metric_field
metric
=
get_invalid_metric_value
params
=
{
"metric"
:
metric
}
params
=
{
metric_field
:
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"
})
"err_msg"
:
"{} metric type is invalid for "
"float vector"
.
format
(
metric
)})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_calc_distance_not_support_metric
(
self
,
get_not_support_metric
):
def
test_calc_distance_not_support_metric
(
self
,
get_
support_metric_field
,
get_
not_support_metric
):
"""
target: test calculated distance with invalid metric
method: input invalid metric
...
...
@@ -286,15 +292,17 @@ class TestUtilityParams(TestcaseBase):
vectors_r
=
cf
.
gen_vectors
(
default_nb
,
default_dim
)
op_l
=
{
"float_vectors"
:
vectors_l
}
op_r
=
{
"float_vectors"
:
vectors_r
}
metric_field
=
get_support_metric_field
metric
=
get_not_support_metric
params
=
{
"metric"
:
metric
}
params
=
{
metric_field
:
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"
})
"err_msg"
:
"{} metric type is invalid for "
"float vector"
.
format
(
metric
)})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_calc_distance_invalid_using
(
self
):
def
test_calc_distance_invalid_using
(
self
,
get_support_metric_field
):
"""
target: test calculated distance with invalid using
method: input invalid using
...
...
@@ -305,7 +313,8 @@ class TestUtilityParams(TestcaseBase):
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
}
metric_field
=
get_support_metric_field
params
=
{
metric_field
:
"L2"
,
"sqrt"
:
True
}
using
=
"empty"
self
.
utility_wrap
.
calc_distance
(
op_l
,
op_r
,
params
,
using
=
using
,
check_task
=
CheckTasks
.
err_res
,
...
...
@@ -332,7 +341,7 @@ class TestUtilityParams(TestcaseBase):
"vectors with different dimension"
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_calc_distance_collection_before_load
(
self
):
def
test_calc_distance_collection_before_load
(
self
,
get_support_metric_field
):
"""
target: test calculated distance when entities is not ready
method: calculate distance before load
...
...
@@ -347,7 +356,8 @@ class TestUtilityParams(TestcaseBase):
"field"
:
default_field_name
}
op_r
=
{
"ids"
:
insert_ids
[
middle
:],
"collection"
:
collection_w
.
name
,
"field"
:
default_field_name
}
params
=
{
"metric"
:
"L2"
,
"sqrt"
:
True
}
metric_field
=
get_support_metric_field
params
=
{
metric_field
:
"L2"
,
"sqrt"
:
True
}
self
.
utility_wrap
.
calc_distance
(
op_l
,
op_r
,
params
,
check_task
=
CheckTasks
.
err_res
,
check_items
=
{
"err_code"
:
1
,
...
...
@@ -357,6 +367,10 @@ class TestUtilityParams(TestcaseBase):
class
TestUtilityBase
(
TestcaseBase
):
""" Test case of index interface """
@
pytest
.
fixture
(
scope
=
"function"
,
params
=
[
"metric_type"
,
"metric"
])
def
metric_field
(
self
,
request
):
yield
request
.
param
@
pytest
.
fixture
(
scope
=
"function"
,
params
=
[
True
,
False
])
def
sqrt
(
self
,
request
):
yield
request
.
param
...
...
@@ -630,7 +644,7 @@ class TestUtilityBase(TestcaseBase):
"vectors_r"
:
vectors_r
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_calc_distance_default_sqrt
(
self
,
metric
):
def
test_calc_distance_default_sqrt
(
self
,
metric
_field
,
metric
):
"""
target: test calculated distance with default param
method: calculated distance with default sqrt
...
...
@@ -641,7 +655,7 @@ class TestUtilityBase(TestcaseBase):
vectors_r
=
cf
.
gen_vectors
(
default_nb
,
default_dim
)
op_l
=
{
"float_vectors"
:
vectors_l
}
op_r
=
{
"float_vectors"
:
vectors_r
}
params
=
{
"metric"
:
metric
}
params
=
{
metric_field
:
metric
}
self
.
utility_wrap
.
calc_distance
(
op_l
,
op_r
,
params
,
check_task
=
CheckTasks
.
check_distance
,
check_items
=
{
"vectors_l"
:
vectors_l
,
...
...
@@ -649,7 +663,6 @@ class TestUtilityBase(TestcaseBase):
"metric"
:
metric
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
xfail
(
reason
=
"issue 7217"
)
def
test_calc_distance_default_metric
(
self
,
sqrt
):
"""
target: test calculated distance with default param
...
...
@@ -669,7 +682,7 @@ class TestUtilityBase(TestcaseBase):
"sqrt"
:
sqrt
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_calc_distance_binary_metric
(
self
,
metric_binary
):
def
test_calc_distance_binary_metric
(
self
,
metric_
field
,
metric_
binary
):
"""
target: test calculate distance with binary vectors
method: calculate distance between binary vectors
...
...
@@ -681,7 +694,7 @@ class TestUtilityBase(TestcaseBase):
raw_vectors_r
,
vectors_r
=
cf
.
gen_binary_vectors
(
nb
,
default_dim
)
op_l
=
{
"bin_vectors"
:
vectors_l
}
op_r
=
{
"bin_vectors"
:
vectors_r
}
params
=
{
"metric"
:
metric_binary
}
params
=
{
metric_field
:
metric_binary
}
vectors_l
=
raw_vectors_l
vectors_r
=
raw_vectors_r
self
.
utility_wrap
.
calc_distance
(
op_l
,
op_r
,
params
,
...
...
@@ -691,7 +704,7 @@ class TestUtilityBase(TestcaseBase):
"metric"
:
metric_binary
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L1
)
def
test_calc_distance_from_collection_ids
(
self
,
metric
,
sqrt
):
def
test_calc_distance_from_collection_ids
(
self
,
metric
_field
,
metric
,
sqrt
):
"""
target: test calculated distance from collection entities
method: both left and right vectors are from collection
...
...
@@ -710,7 +723,7 @@ class TestUtilityBase(TestcaseBase):
"field"
:
default_field_name
}
op_r
=
{
"ids"
:
insert_ids
[
middle
:],
"collection"
:
collection_w
.
name
,
"field"
:
default_field_name
}
params
=
{
"metric"
:
metric
,
"sqrt"
:
sqrt
}
params
=
{
metric_field
:
metric
,
"sqrt"
:
sqrt
}
self
.
utility_wrap
.
calc_distance
(
op_l
,
op_r
,
params
,
check_task
=
CheckTasks
.
check_distance
,
check_items
=
{
"vectors_l"
:
vectors_l
,
...
...
@@ -719,7 +732,7 @@ class TestUtilityBase(TestcaseBase):
"sqrt"
:
sqrt
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_calc_distance_from_collections
(
self
,
metric
,
sqrt
):
def
test_calc_distance_from_collections
(
self
,
metric
_field
,
metric
,
sqrt
):
"""
target: test calculated distance between entities from collections
method: calculated distance between entities from two collections
...
...
@@ -736,7 +749,7 @@ class TestUtilityBase(TestcaseBase):
"field"
:
default_field_name
}
op_r
=
{
"ids"
:
insert_ids_1
,
"collection"
:
collection_w_1
.
name
,
"field"
:
default_field_name
}
params
=
{
"metric"
:
metric
,
"sqrt"
:
sqrt
}
params
=
{
metric_field
:
metric
,
"sqrt"
:
sqrt
}
self
.
utility_wrap
.
calc_distance
(
op_l
,
op_r
,
params
,
check_task
=
CheckTasks
.
check_distance
,
check_items
=
{
"vectors_l"
:
vectors_l
,
...
...
@@ -745,7 +758,7 @@ class TestUtilityBase(TestcaseBase):
"sqrt"
:
sqrt
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_calc_distance_left_vector_and_collection_ids
(
self
,
metric
,
sqrt
):
def
test_calc_distance_left_vector_and_collection_ids
(
self
,
metric
_field
,
metric
,
sqrt
):
"""
target: test calculated distance from collection entities
method: set left vectors as random vectors, right vectors from collection
...
...
@@ -763,7 +776,7 @@ class TestUtilityBase(TestcaseBase):
op_l
=
{
"float_vectors"
:
vectors_l
}
op_r
=
{
"ids"
:
insert_ids
[
middle
:],
"collection"
:
collection_w
.
name
,
"field"
:
default_field_name
}
params
=
{
"metric"
:
metric
,
"sqrt"
:
sqrt
}
params
=
{
metric_field
:
metric
,
"sqrt"
:
sqrt
}
self
.
utility_wrap
.
calc_distance
(
op_l
,
op_r
,
params
,
check_task
=
CheckTasks
.
check_distance
,
check_items
=
{
"vectors_l"
:
vectors_l
,
...
...
@@ -772,7 +785,7 @@ class TestUtilityBase(TestcaseBase):
"sqrt"
:
sqrt
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_calc_distance_right_vector_and_collection_ids
(
self
,
metric
,
sqrt
):
def
test_calc_distance_right_vector_and_collection_ids
(
self
,
metric
_field
,
metric
,
sqrt
):
"""
target: test calculated distance from collection entities
method: set right vectors as random vectors, left vectors from collection
...
...
@@ -788,7 +801,7 @@ class TestUtilityBase(TestcaseBase):
op_l
=
{
"ids"
:
insert_ids
[:
middle
],
"collection"
:
collection_w
.
name
,
"field"
:
default_field_name
}
op_r
=
{
"float_vectors"
:
vectors_r
}
params
=
{
"metric"
:
metric
,
"sqrt"
:
sqrt
}
params
=
{
metric_field
:
metric
,
"sqrt"
:
sqrt
}
self
.
utility_wrap
.
calc_distance
(
op_l
,
op_r
,
params
,
check_task
=
CheckTasks
.
check_distance
,
check_items
=
{
"vectors_l"
:
vectors_l
,
...
...
@@ -797,7 +810,7 @@ class TestUtilityBase(TestcaseBase):
"sqrt"
:
sqrt
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_calc_distance_from_partition_ids
(
self
,
metric
,
sqrt
):
def
test_calc_distance_from_partition_ids
(
self
,
metric
_field
,
metric
,
sqrt
):
"""
target: test calculated distance from one partition entities
method: both left and right vectors are from partition
...
...
@@ -808,7 +821,7 @@ class TestUtilityBase(TestcaseBase):
collection_w
,
vectors
,
_
,
insert_ids
=
self
.
init_collection_general
(
prefix
,
True
,
nb
,
partition_num
=
1
)
partitions
=
collection_w
.
partitions
middle
=
len
(
insert_ids
)
//
2
params
=
{
"metric"
:
metric
,
"sqrt"
:
sqrt
}
params
=
{
metric_field
:
metric
,
"sqrt"
:
sqrt
}
for
i
in
range
(
len
(
partitions
)):
vectors_l
=
vectors
[
i
].
loc
[:,
default_field_name
]
vectors_r
=
vectors
[
i
].
loc
[:,
default_field_name
]
...
...
@@ -824,7 +837,7 @@ class TestUtilityBase(TestcaseBase):
"sqrt"
:
sqrt
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_calc_distance_from_partitions
(
self
,
metric
,
sqrt
):
def
test_calc_distance_from_partitions
(
self
,
metric
_field
,
metric
,
sqrt
):
"""
target: test calculated distance between entities from partitions
method: calculate distance between entities from two partitions
...
...
@@ -835,7 +848,7 @@ class TestUtilityBase(TestcaseBase):
collection_w
,
vectors
,
_
,
insert_ids
=
self
.
init_collection_general
(
prefix
,
True
,
nb
,
partition_num
=
1
)
partitions
=
collection_w
.
partitions
middle
=
len
(
insert_ids
)
//
2
params
=
{
"metric"
:
metric
,
"sqrt"
:
sqrt
}
params
=
{
metric_field
:
metric
,
"sqrt"
:
sqrt
}
vectors_l
=
vectors
[
0
].
loc
[:,
default_field_name
]
vectors_r
=
vectors
[
1
].
loc
[:,
default_field_name
]
op_l
=
{
"ids"
:
insert_ids
[:
middle
],
"collection"
:
collection_w
.
name
,
...
...
@@ -850,7 +863,7 @@ class TestUtilityBase(TestcaseBase):
"sqrt"
:
sqrt
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_calc_distance_left_vectors_and_partition_ids
(
self
,
metric
,
sqrt
):
def
test_calc_distance_left_vectors_and_partition_ids
(
self
,
metric
_field
,
metric
,
sqrt
):
"""
target: test calculated distance between vectors and partition entities
method: set left vectors as random vectors, right vectors are entities
...
...
@@ -863,7 +876,7 @@ class TestUtilityBase(TestcaseBase):
partitions
=
collection_w
.
partitions
vectors_l
=
cf
.
gen_vectors
(
nb
//
2
,
default_dim
)
op_l
=
{
"float_vectors"
:
vectors_l
}
params
=
{
"metric"
:
metric
,
"sqrt"
:
sqrt
}
params
=
{
metric_field
:
metric
,
"sqrt"
:
sqrt
}
for
i
in
range
(
len
(
partitions
)):
vectors_r
=
vectors
[
i
].
loc
[:,
default_field_name
]
op_r
=
{
"ids"
:
insert_ids
[
middle
:],
"collection"
:
collection_w
.
name
,
...
...
@@ -876,7 +889,7 @@ class TestUtilityBase(TestcaseBase):
"sqrt"
:
sqrt
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_calc_distance_right_vectors_and_partition_ids
(
self
,
metric
,
sqrt
):
def
test_calc_distance_right_vectors_and_partition_ids
(
self
,
metric
_field
,
metric
,
sqrt
):
"""
target: test calculated distance between vectors and partition entities
method: set right vectors as random vectors, left vectors are entities
...
...
@@ -889,7 +902,7 @@ class TestUtilityBase(TestcaseBase):
partitions
=
collection_w
.
partitions
vectors_r
=
cf
.
gen_vectors
(
nb
//
2
,
default_dim
)
op_r
=
{
"float_vectors"
:
vectors_r
}
params
=
{
"metric"
:
metric
,
"sqrt"
:
sqrt
}
params
=
{
metric_field
:
metric
,
"sqrt"
:
sqrt
}
for
i
in
range
(
len
(
partitions
)):
vectors_l
=
vectors
[
i
].
loc
[:,
default_field_name
]
op_l
=
{
"ids"
:
insert_ids
[
middle
:],
"collection"
:
collection_w
.
name
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录