Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
fb358af0
M
milvus
项目概览
milvus
/
milvus
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
未验证
提交
fb358af0
编写于
6月 07, 2021
作者:
Y
yanliang567
提交者:
GitHub
6月 07, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[skip ci] Update the name to init_collection (#5643)
Signed-off-by:
N
yanliang567
<
yanliang.qiao@zilliz.com
>
上级
6e9a4e36
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
63 addition
and
62 deletion
+63
-62
tests20/chaos/checker.py
tests20/chaos/checker.py
+1
-1
tests20/chaos/test_chaos.py
tests20/chaos/test_chaos.py
+2
-2
tests20/python_client/base/client_base.py
tests20/python_client/base/client_base.py
+4
-3
tests20/python_client/base/collection_wrapper.py
tests20/python_client/base/collection_wrapper.py
+1
-1
tests20/python_client/testcases/test_collection.py
tests20/python_client/testcases/test_collection.py
+49
-49
tests20/python_client/testcases/test_index.py
tests20/python_client/testcases/test_index.py
+1
-1
tests20/python_client/testcases/test_partition.py
tests20/python_client/testcases/test_partition.py
+1
-1
tests20/python_client/testcases/test_search.py
tests20/python_client/testcases/test_search.py
+2
-2
tests20/python_client/testcases/test_utility.py
tests20/python_client/testcases/test_utility.py
+2
-2
未找到文件。
tests20/chaos/checker.py
浏览文件 @
fb358af0
...
...
@@ -71,7 +71,7 @@ class CreateChecker(Checker):
def
keep_creating
(
self
):
while
self
.
_running
is
True
:
collection
,
result
=
self
.
c_wrapper
.
collection_init
(
name
=
cf
.
gen_unique_str
(),
collection
,
result
=
self
.
c_wrapper
.
init_collection
(
name
=
cf
.
gen_unique_str
(),
schema
=
cf
.
gen_default_collection_schema
(),
check_task
=
"check_nothing"
)
if
result
is
True
:
...
...
tests20/chaos/test_chaos.py
浏览文件 @
fb358af0
...
...
@@ -22,7 +22,7 @@ class TestsChaos:
if
res
is
None
:
raise
Exception
(
"no connections"
)
c_wrapper
=
ApiCollectionWrapper
()
c_wrapper
.
collection_init
(
name
=
cf
.
gen_unique_str
(),
c_wrapper
.
init_collection
(
name
=
cf
.
gen_unique_str
(),
schema
=
cf
.
gen_default_collection_schema
(),
check_task
=
"check_nothing"
)
return
c_wrapper
...
...
@@ -34,7 +34,7 @@ class TestsChaos:
if
res
is
None
:
raise
Exception
(
"no connections"
)
c_wrapper
=
ApiCollectionWrapper
()
_
,
result
=
c_wrapper
.
collection_init
(
name
=
cf
.
gen_unique_str
(),
_
,
result
=
c_wrapper
.
init_collection
(
name
=
cf
.
gen_unique_str
(),
schema
=
cf
.
gen_default_collection_schema
(),
check_task
=
"check_nothing"
)
if
result
is
False
:
...
...
tests20/python_client/base/client_base.py
浏览文件 @
fb358af0
...
...
@@ -100,15 +100,16 @@ class TestcaseBase(Base):
self
.
connection_wrap
.
add_connection
(
default
=
{
"host"
:
param_info
.
param_host
,
"port"
:
param_info
.
param_port
})
res
,
_
=
self
.
connection_wrap
.
connect
(
alias
=
'default'
)
return
res
'''
def _collection(self, **kwargs):
""" Init a collection and return the object of collection """
name = cf.gen_unique_str()
schema = cf.gen_default_collection_schema()
if self.connection_wrap.get_connection(alias='default') is None:
self._connect()
res
,
cr
=
self
.
collection_wrap
.
collection_init
(
name
=
name
,
schema
=
schema
,
**
kwargs
)
res, cr = self.collection_wrap.
init_collection
(name=name, schema=schema, **kwargs)
return res
'''
def
init_collection_wrap
(
self
,
name
=
None
,
data
=
None
,
schema
=
None
,
check_task
=
None
,
**
kwargs
):
name
=
cf
.
gen_unique_str
(
'coll_'
)
if
name
is
None
else
name
...
...
@@ -116,7 +117,7 @@ class TestcaseBase(Base):
if
self
.
connection_wrap
.
get_connection
(
alias
=
'default'
)[
0
]
is
None
:
self
.
_connect
()
collection_w
=
ApiCollectionWrapper
()
collection_w
.
collection_init
(
name
=
name
,
data
=
data
,
schema
=
schema
,
collection_w
.
init_collection
(
name
=
name
,
data
=
data
,
schema
=
schema
,
check_task
=
check_task
,
**
kwargs
)
return
collection_w
...
...
tests20/python_client/base/collection_wrapper.py
浏览文件 @
fb358af0
...
...
@@ -9,7 +9,7 @@ from utils.api_request import api_request
class
ApiCollectionWrapper
:
collection
=
None
def
collection_init
(
self
,
name
,
data
=
None
,
schema
=
None
,
check_task
=
None
,
check_params
=
None
,
**
kwargs
):
def
init_collection
(
self
,
name
,
data
=
None
,
schema
=
None
,
check_task
=
None
,
check_params
=
None
,
**
kwargs
):
""" In order to distinguish the same name of collection """
func_name
=
sys
.
_getframe
().
f_code
.
co_name
res
,
is_succ
=
api_request
([
Collection
,
name
,
data
,
schema
],
**
kwargs
)
...
...
tests20/python_client/testcases/test_collection.py
浏览文件 @
fb358af0
此差异已折叠。
点击以展开。
tests20/python_client/testcases/test_index.py
浏览文件 @
fb358af0
...
...
@@ -336,7 +336,7 @@ class TestIndexAdvanced(TestcaseBase):
collection
=
self
.
_collection
(
c_name
)
api_collection_2
=
ApiCollectionWrapper
()
api_index_2
=
ApiIndexWrapper
()
collection_2
=
api_collection_2
.
collection_init
(
c_name_2
)
collection_2
=
api_collection_2
.
init_collection
(
c_name_2
)
self
.
index_wrap
.
index_init
(
collection
,
default_field_name
,
default_index_params
,
name
=
index_name
)
index_2
,
_
=
api_index_2
.
index_init
(
collection_2
,
default_field_name
,
default_index_params
,
name
=
index_name
)
self
.
index_wrap
.
drop
()
...
...
tests20/python_client/testcases/test_partition.py
浏览文件 @
fb358af0
...
...
@@ -41,7 +41,7 @@ class TestPartitionParams(TestcaseBase):
method: 1. create a partition empty none name
expected: 1. raise exception
"""
self
.
collection_wrap
.
collection_init
()
self
.
collection_wrap
.
init_collection
()
# create a collection
collection_w
=
self
.
init_collection_wrap
()
...
...
tests20/python_client/testcases/test_search.py
浏览文件 @
fb358af0
...
...
@@ -42,7 +42,7 @@ class TestCollectionSearch(TestcaseBase):
default_schema
=
cf
.
gen_default_collection_schema
()
else
:
default_schema
=
cf
.
gen_default_binary_collection_schema
()
collection
,
_
=
self
.
collection_wrap
.
collection_init
(
default_collection_name
,
collection
,
_
=
self
.
collection_wrap
.
init_collection
(
default_collection_name
,
data
=
None
,
schema
=
default_schema
)
# 2 add extra partition if specified (default is 1 partition named "_default")
if
partition_num
>
0
:
...
...
@@ -126,7 +126,7 @@ class TestCollectionSearch(TestcaseBase):
res_list
,
_
=
self
.
utility_wrap
.
list_collections
()
count
=
0
for
res
in
res_list
:
collection
,
_
=
self
.
collection_wrap
.
collection_init
(
name
=
res
)
collection
,
_
=
self
.
collection_wrap
.
init_collection
(
name
=
res
)
if
"search_collection"
in
res
:
self
.
clear_data
(
collection
)
count
=
count
+
1
...
...
tests20/python_client/testcases/test_utility.py
浏览文件 @
fb358af0
...
...
@@ -462,7 +462,7 @@ class TestUtilityAdvanced(TestcaseBase):
c_name_2
=
cf
.
gen_unique_str
(
prefix
)
self
.
_collection
(
c_name
)
api_c
=
ApiCollectionWrapper
()
api_c
.
collection_init
(
c_name_2
)
api_c
.
init_collection
(
c_name_2
)
for
name
in
[
c_name
,
c_name_2
]:
res
,
_
=
ut
.
has_collection
(
name
)
assert
res
is
True
...
...
@@ -480,7 +480,7 @@ class TestUtilityAdvanced(TestcaseBase):
c_name_2
=
cf
.
gen_unique_str
(
prefix
)
self
.
_collection
(
c_name
)
api_c
=
ApiCollectionWrapper
()
api_c
.
collection_init
(
c_name_2
)
api_c
.
init_collection
(
c_name_2
)
res
,
_
=
ut
.
list_collections
()
for
name
in
[
c_name
,
c_name_2
]:
assert
name
in
res
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录