Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
2deba2dc
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,发现更多精彩内容 >>
提交
2deba2dc
编写于
11月 06, 2019
作者:
Y
yudong.cai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#208 optimize unittest to support run single test more easily
上级
113d08f8
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
54 addition
and
15 deletion
+54
-15
CHANGELOG.md
CHANGELOG.md
+1
-0
core/src/server/Config.cpp
core/src/server/Config.cpp
+10
-4
core/src/server/Config.h
core/src/server/Config.h
+2
-1
core/unittest/db/CMakeLists.txt
core/unittest/db/CMakeLists.txt
+10
-2
core/unittest/db/utils.cpp
core/unittest/db/utils.cpp
+2
-2
core/unittest/metrics/CMakeLists.txt
core/unittest/metrics/CMakeLists.txt
+5
-1
core/unittest/scheduler/CMakeLists.txt
core/unittest/scheduler/CMakeLists.txt
+11
-1
core/unittest/scheduler/test_task.cpp
core/unittest/scheduler/test_task.cpp
+0
-0
core/unittest/server/CMakeLists.txt
core/unittest/server/CMakeLists.txt
+6
-1
core/unittest/wrapper/CMakeLists.txt
core/unittest/wrapper/CMakeLists.txt
+5
-1
core/unittest/wrapper/utils.cpp
core/unittest/wrapper/utils.cpp
+2
-2
未找到文件。
CHANGELOG.md
浏览文件 @
2deba2dc
...
@@ -9,6 +9,7 @@ Please mark all change in change log and use the ticket from JIRA.
...
@@ -9,6 +9,7 @@ Please mark all change in change log and use the ticket from JIRA.
## Improvement
## Improvement
-
\#
207 - Add more unittest for config set/get
-
\#
207 - Add more unittest for config set/get
-
\#
208 - optimize unittest to support run single test more easily
## Task
## Task
...
...
core/src/server/Config.cpp
浏览文件 @
2deba2dc
...
@@ -795,11 +795,16 @@ Config::GetConfigStr(const std::string& parent_key, const std::string& child_key
...
@@ -795,11 +795,16 @@ Config::GetConfigStr(const std::string& parent_key, const std::string& child_key
}
}
std
::
string
std
::
string
Config
::
GetConfigSequenceStr
(
const
std
::
string
&
parent_key
,
const
std
::
string
&
child_key
,
const
std
::
string
&
delim
)
{
Config
::
GetConfigSequenceStr
(
const
std
::
string
&
parent_key
,
const
std
::
string
&
child_key
,
const
std
::
string
&
delim
,
const
std
::
string
&
default_value
)
{
std
::
string
value
;
std
::
string
value
;
if
(
!
GetConfigValueInMem
(
parent_key
,
child_key
,
value
).
ok
())
{
if
(
!
GetConfigValueInMem
(
parent_key
,
child_key
,
value
).
ok
())
{
std
::
vector
<
std
::
string
>
sequence
=
GetConfigNode
(
parent_key
).
GetSequence
(
child_key
);
std
::
vector
<
std
::
string
>
sequence
=
GetConfigNode
(
parent_key
).
GetSequence
(
child_key
);
if
(
sequence
.
empty
())
{
value
=
default_value
;
}
else
{
server
::
StringHelpFunctions
::
MergeStringWithDelimeter
(
sequence
,
delim
,
value
);
server
::
StringHelpFunctions
::
MergeStringWithDelimeter
(
sequence
,
delim
,
value
);
}
SetConfigValueInMem
(
parent_key
,
child_key
,
value
);
SetConfigValueInMem
(
parent_key
,
child_key
,
value
);
}
}
return
value
;
return
value
;
...
@@ -1028,8 +1033,9 @@ Config::GetResourceConfigMode(std::string& value) {
...
@@ -1028,8 +1033,9 @@ Config::GetResourceConfigMode(std::string& value) {
Status
Status
Config
::
GetResourceConfigSearchResources
(
std
::
vector
<
std
::
string
>&
value
)
{
Config
::
GetResourceConfigSearchResources
(
std
::
vector
<
std
::
string
>&
value
)
{
std
::
string
str
=
GetConfigSequenceStr
(
CONFIG_RESOURCE
,
CONFIG_RESOURCE_SEARCH_RESOURCES
,
std
::
string
str
=
CONFIG_RESOURCE_SEARCH_RESOURCES_DELIMITER
);
GetConfigSequenceStr
(
CONFIG_RESOURCE
,
CONFIG_RESOURCE_SEARCH_RESOURCES
,
CONFIG_RESOURCE_SEARCH_RESOURCES_DELIMITER
,
CONFIG_RESOURCE_SEARCH_RESOURCES_DEFAULT
);
server
::
StringHelpFunctions
::
SplitStringByDelimeter
(
str
,
CONFIG_RESOURCE_SEARCH_RESOURCES_DELIMITER
,
value
);
server
::
StringHelpFunctions
::
SplitStringByDelimeter
(
str
,
CONFIG_RESOURCE_SEARCH_RESOURCES_DELIMITER
,
value
);
return
CheckResourceConfigSearchResources
(
value
);
return
CheckResourceConfigSearchResources
(
value
);
}
}
...
...
core/src/server/Config.h
浏览文件 @
2deba2dc
...
@@ -186,7 +186,8 @@ class Config {
...
@@ -186,7 +186,8 @@ class Config {
std
::
string
std
::
string
GetConfigStr
(
const
std
::
string
&
parent_key
,
const
std
::
string
&
child_key
,
const
std
::
string
&
default_value
=
""
);
GetConfigStr
(
const
std
::
string
&
parent_key
,
const
std
::
string
&
child_key
,
const
std
::
string
&
default_value
=
""
);
std
::
string
std
::
string
GetConfigSequenceStr
(
const
std
::
string
&
parent_key
,
const
std
::
string
&
child_key
,
const
std
::
string
&
delim
);
GetConfigSequenceStr
(
const
std
::
string
&
parent_key
,
const
std
::
string
&
child_key
,
const
std
::
string
&
delim
=
","
,
const
std
::
string
&
default_value
=
""
);
public:
public:
/* server config */
/* server config */
...
...
core/unittest/db/CMakeLists.txt
浏览文件 @
2deba2dc
...
@@ -17,8 +17,16 @@
...
@@ -17,8 +17,16 @@
# under the License.
# under the License.
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
set
(
test_files
aux_source_directory
(
${
CMAKE_CURRENT_SOURCE_DIR
}
test_files
)
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_db.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_db_mysql.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_engine.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_mem.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_meta.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_meta_mysql.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_misc.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_search.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/utils.cpp
)
cuda_add_executable
(
test_db
cuda_add_executable
(
test_db
${
common_files
}
${
common_files
}
...
...
core/unittest/db/utils.cpp
浏览文件 @
2deba2dc
...
@@ -60,8 +60,8 @@ static const char
...
@@ -60,8 +60,8 @@ static const char
" port: 8080 # port prometheus used to fetch metrics
\n
"
" port: 8080 # port prometheus used to fetch metrics
\n
"
"
\n
"
"
\n
"
"cache_config:
\n
"
"cache_config:
\n
"
" cpu_
mem
_capacity: 16 # GB, CPU memory used for cache
\n
"
" cpu_
cache
_capacity: 16 # GB, CPU memory used for cache
\n
"
" cpu_
mem
_threshold: 0.85 # percentage of data kept when cache cleanup triggered
\n
"
" cpu_
cache
_threshold: 0.85 # percentage of data kept when cache cleanup triggered
\n
"
" cache_insert_data: false # whether load inserted data into cache
\n
"
" cache_insert_data: false # whether load inserted data into cache
\n
"
"
\n
"
"
\n
"
"engine_config:
\n
"
"engine_config:
\n
"
...
...
core/unittest/metrics/CMakeLists.txt
浏览文件 @
2deba2dc
...
@@ -17,7 +17,11 @@
...
@@ -17,7 +17,11 @@
# under the License.
# under the License.
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
aux_source_directory
(
${
CMAKE_CURRENT_SOURCE_DIR
}
test_files
)
set
(
test_files
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_metricbase.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_metrics.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_prometheus.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/utils.cpp
)
add_executable
(
test_metrics
add_executable
(
test_metrics
${
common_files
}
${
common_files
}
...
...
core/unittest/scheduler/CMakeLists.txt
浏览文件 @
2deba2dc
...
@@ -17,7 +17,17 @@
...
@@ -17,7 +17,17 @@
# under the License.
# under the License.
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
aux_source_directory
(
${
CMAKE_CURRENT_SOURCE_DIR
}
test_files
)
set
(
test_files
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_algorithm.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_event.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_node.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_normal.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_resource.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_resource_factory.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_resource_mgr.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_scheduler.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_task.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_tasktable.cpp
)
cuda_add_executable
(
test_scheduler
cuda_add_executable
(
test_scheduler
${
common_files
}
${
common_files
}
...
...
core/unittest/scheduler/t
ask_test
.cpp
→
core/unittest/scheduler/t
est_task
.cpp
浏览文件 @
2deba2dc
文件已移动
core/unittest/server/CMakeLists.txt
浏览文件 @
2deba2dc
...
@@ -17,7 +17,12 @@
...
@@ -17,7 +17,12 @@
# under the License.
# under the License.
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
aux_source_directory
(
${
CMAKE_CURRENT_SOURCE_DIR
}
test_files
)
set
(
test_files
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_cache.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_config.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_rpc.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_util.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/utils.cpp
)
include_directories
(
"
${
CUDA_TOOLKIT_ROOT_DIR
}
/include"
)
include_directories
(
"
${
CUDA_TOOLKIT_ROOT_DIR
}
/include"
)
link_directories
(
"
${
CUDA_TOOLKIT_ROOT_DIR
}
/lib64"
)
link_directories
(
"
${
CUDA_TOOLKIT_ROOT_DIR
}
/lib64"
)
...
...
core/unittest/wrapper/CMakeLists.txt
浏览文件 @
2deba2dc
...
@@ -17,7 +17,11 @@
...
@@ -17,7 +17,11 @@
# under the License.
# under the License.
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
aux_source_directory
(
${
CMAKE_CURRENT_SOURCE_DIR
}
test_files
)
set
(
test_files
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_hybrid_index.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_knowhere.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/test_wrapper.cpp
${
CMAKE_CURRENT_SOURCE_DIR
}
/utils.cpp
)
set
(
wrapper_files
set
(
wrapper_files
${
MILVUS_ENGINE_SRC
}
/wrapper/DataTransfer.cpp
${
MILVUS_ENGINE_SRC
}
/wrapper/DataTransfer.cpp
...
...
core/unittest/wrapper/utils.cpp
浏览文件 @
2deba2dc
...
@@ -50,8 +50,8 @@ static const char
...
@@ -50,8 +50,8 @@ static const char
" port: 8080 # port prometheus used to fetch metrics
\n
"
" port: 8080 # port prometheus used to fetch metrics
\n
"
"
\n
"
"
\n
"
"cache_config:
\n
"
"cache_config:
\n
"
" cpu_
mem
_capacity: 16 # GB, CPU memory used for cache
\n
"
" cpu_
cache
_capacity: 16 # GB, CPU memory used for cache
\n
"
" cpu_
mem
_threshold: 0.85 # percentage of data kept when cache cleanup triggered
\n
"
" cpu_
cache
_threshold: 0.85 # percentage of data kept when cache cleanup triggered
\n
"
" cache_insert_data: false # whether load inserted data into cache
\n
"
" cache_insert_data: false # whether load inserted data into cache
\n
"
"
\n
"
"
\n
"
"engine_config:
\n
"
"engine_config:
\n
"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录