Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
f2c902e3
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,发现更多精彩内容 >>
未验证
提交
f2c902e3
编写于
5月 09, 2023
作者:
N
nico
提交者:
GitHub
5月 09, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Modify test cases (#23939)
Signed-off-by:
N
nico
<
cheng.yuan@zilliz.com
>
上级
de4b4daf
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
11 deletion
+24
-11
tests/python_client/base/client_base.py
tests/python_client/base/client_base.py
+2
-2
tests/python_client/common/common_type.py
tests/python_client/common/common_type.py
+1
-0
tests/python_client/testcases/test_collection.py
tests/python_client/testcases/test_collection.py
+18
-7
tests/python_client/testcases/test_search.py
tests/python_client/testcases/test_search.py
+3
-2
未找到文件。
tests/python_client/base/client_base.py
浏览文件 @
f2c902e3
...
...
@@ -115,13 +115,13 @@ class TestcaseBase(Base):
port
=
cf
.
param_info
.
param_port
)
return
res
def
init_collection_wrap
(
self
,
name
=
None
,
schema
=
None
,
shards_num
=
2
,
check_task
=
None
,
check_items
=
None
,
**
kwargs
):
def
init_collection_wrap
(
self
,
name
=
None
,
schema
=
None
,
check_task
=
None
,
check_items
=
None
,
**
kwargs
):
name
=
cf
.
gen_unique_str
(
'coll_'
)
if
name
is
None
else
name
schema
=
cf
.
gen_default_collection_schema
()
if
schema
is
None
else
schema
if
not
self
.
connection_wrap
.
has_connection
(
alias
=
DefaultConfig
.
DEFAULT_USING
)[
0
]:
self
.
_connect
()
collection_w
=
ApiCollectionWrapper
()
collection_w
.
init_collection
(
name
=
name
,
schema
=
schema
,
shards_num
=
shards_num
,
check_task
=
check_task
,
collection_w
.
init_collection
(
name
=
name
,
schema
=
schema
,
check_task
=
check_task
,
check_items
=
check_items
,
**
kwargs
)
self
.
collection_object_list
.
append
(
collection_w
)
return
collection_w
...
...
tests/python_client/common/common_type.py
浏览文件 @
f2c902e3
...
...
@@ -63,6 +63,7 @@ max_field_num = 64 # Maximum number of fields in a collection
max_name_length
=
255
# Maximum length of name for a collection or alias
default_replica_num
=
1
default_graceful_time
=
5
#
default_shards_num
=
1
max_shards_num
=
16
IMAGE_REPOSITORY_MILVUS
=
"harbor.milvus.io/dockerhub/milvusdb/milvus"
NAMESPACE_CHAOS_TESTING
=
"chaos-testing"
...
...
tests/python_client/testcases/test_collection.py
浏览文件 @
f2c902e3
import
random
import
numpy
import
pandas
as
pd
import
pytest
...
...
@@ -2262,7 +2264,7 @@ class TestLoadCollection(TestcaseBase):
collection_w
.
load
()
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
skip
(
reason
=
"issue #23499"
)
#
@pytest.mark.skip(reason="issue #23499")
def
test_load_partitions_after_release_partition
(
self
):
"""
target: test load collection after release partition and load partitions
...
...
@@ -2286,7 +2288,7 @@ class TestLoadCollection(TestcaseBase):
partition_w2
.
load
()
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
skip
(
reason
=
"issue #23499"
)
#
@pytest.mark.skip(reason="issue #23499")
def
test_load_collection_after_release_partition_collection
(
self
):
"""
target: test load collection after release partition and collection
...
...
@@ -2303,7 +2305,7 @@ class TestLoadCollection(TestcaseBase):
collection_w
.
load
()
partition_w
.
release
()
error
=
{
ct
.
err_code
:
1
,
ct
.
err_msg
:
'not loaded into memory'
}
collection_w
.
query
(
default_term_expr
,
partition_names
=
[
partition
2
],
collection_w
.
query
(
default_term_expr
,
partition_names
=
[
partition
1
],
check_task
=
CheckTasks
.
err_res
,
check_items
=
error
)
collection_w
.
release
()
collection_w
.
load
()
...
...
@@ -2406,6 +2408,7 @@ class TestLoadCollection(TestcaseBase):
partition_w1
=
self
.
init_partition_wrap
(
collection_w
,
partition1
)
partition_w2
=
self
.
init_partition_wrap
(
collection_w
,
partition2
)
collection_w
.
load
()
partition_w1
.
release
()
partition_w1
.
drop
()
partition_w2
.
release
()
partition_w2
.
load
()
...
...
@@ -2425,6 +2428,7 @@ class TestLoadCollection(TestcaseBase):
partition_w1
=
self
.
init_partition_wrap
(
collection_w
,
partition1
)
partition_w2
=
self
.
init_partition_wrap
(
collection_w
,
partition2
)
collection_w
.
load
()
partition_w1
.
release
()
partition_w1
.
drop
()
partition_w2
.
load
()
collection_w
.
query
(
default_term_expr
,
partition_names
=
[
partition2
])
...
...
@@ -2443,6 +2447,7 @@ class TestLoadCollection(TestcaseBase):
partition_w1
=
self
.
init_partition_wrap
(
collection_w
,
partition1
)
partition_w2
=
self
.
init_partition_wrap
(
collection_w
,
partition2
)
collection_w
.
load
()
partition_w1
.
release
()
partition_w1
.
drop
()
collection_w
.
load
()
collection_w
.
query
(
default_term_expr
,
partition_names
=
[
partition2
])
...
...
@@ -2918,7 +2923,7 @@ class TestDescribeCollection(TestcaseBase):
c_name
=
cf
.
gen_unique_str
(
prefix
)
collection_w
=
self
.
init_collection_wrap
(
name
=
c_name
)
collection_w
.
create_index
(
ct
.
default_float_vec_field_name
,
index_params
=
ct
.
default_flat_index
)
description
=
{
'collection_name'
:
c_name
,
'auto_id'
:
False
,
'description'
:
''
,
description
=
{
'collection_name'
:
c_name
,
'auto_id'
:
False
,
'
num_shards'
:
ct
.
default_shards_num
,
'
description'
:
''
,
'fields'
:
[{
'field_id'
:
100
,
'name'
:
'int64'
,
'description'
:
''
,
'type'
:
5
,
'params'
:
{},
'is_primary'
:
True
,
'auto_id'
:
False
},
{
'field_id'
:
101
,
'name'
:
'float'
,
'description'
:
''
,
'type'
:
10
,
...
...
@@ -3417,11 +3422,13 @@ class TestLoadPartition(TestcaseBase):
partition_w1
=
self
.
init_partition_wrap
(
collection_w
,
partition1
)
partition_w2
=
self
.
init_partition_wrap
(
collection_w
,
partition2
)
partition_w1
.
load
()
partition_w1
.
release
()
partition_w1
.
drop
()
partition_w2
.
load
()
collection_w
.
query
(
default_term_expr
,
partition_names
=
[
partition2
])
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
skip
(
reason
=
"issue #23937"
)
def
test_load_collection_after_load_drop_partition
(
self
):
"""
target: test load collection after load and drop partition
...
...
@@ -3437,6 +3444,7 @@ class TestLoadPartition(TestcaseBase):
partition_w1
=
self
.
init_partition_wrap
(
collection_w
,
partition1
)
partition_w2
=
self
.
init_partition_wrap
(
collection_w
,
partition2
)
partition_w1
.
load
()
partition_w1
.
release
()
partition_w1
.
drop
()
error
=
{
ct
.
err_code
:
1
,
ct
.
err_msg
:
'name not found'
}
collection_w
.
query
(
default_term_expr
,
partition_names
=
[
partition1
,
partition2
],
...
...
@@ -3446,7 +3454,7 @@ class TestLoadPartition(TestcaseBase):
collection_w
.
query
(
default_term_expr
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
skip
(
reason
=
"issue #23
048
"
)
@
pytest
.
mark
.
skip
(
reason
=
"issue #23
536
"
)
def
test_release_load_partition_after_load_drop_partition
(
self
):
"""
target: test release load partition after load and drop partition
...
...
@@ -3460,12 +3468,13 @@ class TestLoadPartition(TestcaseBase):
partition_w1
=
self
.
init_partition_wrap
(
collection_w
,
partition1
)
partition_w2
=
self
.
init_partition_wrap
(
collection_w
,
partition2
)
partition_w1
.
load
()
partition_w1
.
release
()
partition_w1
.
drop
()
partition_w2
.
release
()
partition_w2
.
load
()
collection_w
.
query
(
default_term_expr
,
partition_names
=
[
partition2
])
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
skip
(
reason
=
"issue #23048"
)
def
test_release_load_collection_after_load_drop_partition
(
self
):
"""
target: test release load partition after load and drop partition
...
...
@@ -3479,9 +3488,11 @@ class TestLoadPartition(TestcaseBase):
partition_w1
=
self
.
init_partition_wrap
(
collection_w
,
partition1
)
partition_w2
=
self
.
init_partition_wrap
(
collection_w
,
partition2
)
partition_w1
.
load
()
partition_w1
.
release
()
partition_w1
.
drop
()
partition_w2
.
release
()
partition_w2
.
load
()
collection_w
.
load
()
collection_w
.
query
(
default_term_expr
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_load_another_partition_after_load_drop_partition
(
self
):
...
...
tests/python_client/testcases/test_search.py
浏览文件 @
f2c902e3
...
...
@@ -1090,6 +1090,7 @@ class TestCollectionSearchInvalid(TestcaseBase):
"err_msg"
:
f
"not implemented"
})
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
skip
(
reason
=
"It will report error before range search"
)
@
pytest
.
mark
.
parametrize
(
"metric"
,
[
"SUPERSTRUCTURE"
,
"SUBSTRUCTURE"
])
def
test_range_search_data_type_metric_type_mismatch
(
self
,
metric
):
"""
...
...
@@ -1790,7 +1791,7 @@ class TestCollectionSearch(TestcaseBase):
dim
=
M
*
4
ef
=
limit
self
.
_connect
()
collection_w
,
_
,
_
,
insert_ids
,
time_stamp
=
self
.
init_collection_general
(
prefix
,
True
,
collection_w
,
_
,
_
,
insert_ids
,
time_stamp
=
self
.
init_collection_general
(
prefix
,
True
,
5000
,
partition_num
=
1
,
auto_id
=
auto_id
,
dim
=
dim
,
is_index
=
False
)[
0
:
5
]
...
...
@@ -2964,7 +2965,7 @@ class TestCollectionSearch(TestcaseBase):
if
vectorInsert
!=
vectorRes
:
getcontext
().
rounding
=
getattr
(
decimal
,
'ROUND_HALF_UP'
)
vectorInsert
=
Decimal
(
data
[
field_name
][
res
[
0
][
_id
].
id
][
i
]).
quantize
(
Decimal
(
'0.00000'
))
assert
str
(
vectorInsert
)
==
vectorRes
assert
float
(
str
(
vectorInsert
))
==
float
(
vectorRes
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
skip
(
reason
=
"issue #23661"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录