Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Incubator Pegasus
提交
3242f091
Incubator Pegasus
项目概览
apache
/
Incubator Pegasus
通知
9
Star
5
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Incubator Pegasus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
3242f091
编写于
8月 08, 2019
作者:
W
Wu Tao
提交者:
GitHub
8月 08, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
scripts: travis supports format (#358)
上级
1bcc9112
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
55 addition
and
17 deletion
+55
-17
.gitignore
.gitignore
+1
-0
.travis.yml
.travis.yml
+3
-1
scripts/format_files.sh
scripts/format_files.sh
+2
-2
scripts/travis.sh
scripts/travis.sh
+23
-0
src/base/test/CMakeLists.txt
src/base/test/CMakeLists.txt
+1
-1
src/base/test/run.sh
src/base/test/run.sh
+12
-0
src/geo/bench/bench.cpp
src/geo/bench/bench.cpp
+1
-1
src/redis_protocol/proxy_ut/redis_proxy_test.cpp
src/redis_protocol/proxy_ut/redis_proxy_test.cpp
+2
-4
src/server/test/pegasus_compression_options_test.cpp
src/server/test/pegasus_compression_options_test.cpp
+1
-2
src/shell/commands/data_operations.cpp
src/shell/commands/data_operations.cpp
+8
-4
src/test/function_test/test_recovery.cpp
src/test/function_test/test_recovery.cpp
+1
-2
未找到文件。
.gitignore
浏览文件 @
3242f091
...
...
@@ -94,3 +94,4 @@ LOG
PACKAGE
scripts/py_utils/*.pyc
cmake-build-debug
packages
.travis.yml
浏览文件 @
3242f091
...
...
@@ -13,6 +13,7 @@ addons:
packages
:
-
libsnappy-dev
-
liblz4-dev
-
clang-format-3.9
cache
:
-
ccache
...
...
@@ -30,6 +31,7 @@ install:
-
wget https://github.com/facebook/zstd/archive/v1.3.7.zip; unzip v1.3.7; cd zstd-1.3.7;
-
mkdir cmake-build; cd cmake-build; cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DZSTD_BUILD_PROGRAMS=OFF ../build/cmake; sudo make install -j8;
-
cd ../..
-
rm -rf v1.3.7.zip zstd-1.3.7;
before_script
:
-
cd rdsn/thirdparty
...
...
@@ -40,7 +42,7 @@ before_script:
-
ulimit -c unlimited -S
script
:
-
./
run.sh build --skip_thirdparty --disable_gperf && ./run.sh test
-
./
scripts/travis.sh
after_script
:
-
./run.sh stop_zk
...
...
scripts/format_files.sh
浏览文件 @
3242f091
...
...
@@ -10,13 +10,13 @@ sds=./src/shell/sds
if
[
$#
-eq
0
]
;
then
echo
"formating all .h/.cpp files in
$root_dir
..."
find
.
-type
f
-not
\(
-wholename
"
$linenoise
/*"
-o
-wholename
"
$sds
/*"
-o
-wholename
"./rocksdb/*"
-o
-wholename
"./rdsn/*"
\)
\
-regextype
posix-egrep
-regex
".*
\.
(cpp|h)"
| xargs clang-format
-i
-style
=
file
-regextype
posix-egrep
-regex
".*
\.
(cpp|h)"
| xargs clang-format
-3.9
-i
-style
=
file
elif
[
$1
=
"-h"
]
;
then
echo
"USAGE: ./format-files.sh [<relative_path>] -- format .h/.cpp files in
$root_dir
/relative_path"
echo
" ./format-files.sh means format all .h/.cpp files in
$root_dir
"
else
echo
"formating all .h/.cpp files in
$root_dir
/
$1
..."
find ./
$1
-type
f
-not
\(
-wholename
"
$linenoise
/*"
-o
-wholename
"
$sds
/*"
-o
-wholename
"./rocksdb/*"
-o
-wholename
"./rdsn/*"
\)
\
-regextype
posix-egrep
-regex
".*
\.
(cpp|h)"
| xargs clang-format
-i
-style
=
file
-regextype
posix-egrep
-regex
".*
\.
(cpp|h)"
| xargs clang-format
-3.9
-i
-style
=
file
fi
scripts/travis.sh
0 → 100755
浏览文件 @
3242f091
#!/bin/bash
# to project root directory
script_dir
=
$(
cd
"
$(
dirname
"
$0
"
)
"
&&
pwd
)
root
=
$(
dirname
"
$script_dir
"
)
cd
"
${
root
}
"
||
exit
1
# ensure source files are well formatted
"
${
root
}
"
/scripts/format_files.sh
# ignore updates of submodules
modified
=
$(
git status
-s
--ignore-submodules
)
if
[
"
$modified
"
]
;
then
echo
"
$modified
"
echo
"please format the above files before commit"
exit
1
fi
"
${
root
}
"
/run.sh build
-c
--skip_thirdparty
--disable_gperf
&&
./run.sh
test
if
[
$?
]
;
then
echo
"travis failed with exit code
$?
"
fi
src/base/test/CMakeLists.txt
浏览文件 @
3242f091
...
...
@@ -16,6 +16,6 @@ set(MY_PROJ_LIBS
set
(
MY_BOOST_LIBS Boost::system Boost::filesystem
)
set
(
MY_BINPLACES
"config.ini"
)
set
(
MY_BINPLACES
config.ini run.sh
)
dsn_add_test
()
src/base/test/run.sh
0 → 100755
浏览文件 @
3242f091
#!/usr/bin/env bash
exit_if_fail
()
{
if
[
$1
!=
0
]
;
then
echo
$2
exit
1
fi
}
./base_test
exit_if_fail
$?
"run unit test failed"
src/geo/bench/bench.cpp
浏览文件 @
3242f091
...
...
@@ -89,7 +89,7 @@ int main(int argc, char **argv)
uint64_t
start
=
env
->
NowNanos
();
std
::
atomic
<
uint64_t
>
count
(
test_count
);
dsn
::
utils
::
notify_event
get_completed
;
// test search_radial by lat & lng
for
(
int
i
=
0
;
i
<
test_count
;
++
i
)
{
S2LatLng
latlng
(
S2Testing
::
SamplePoint
(
rect
));
...
...
src/redis_protocol/proxy_ut/redis_proxy_test.cpp
浏览文件 @
3242f091
...
...
@@ -115,8 +115,7 @@ public:
got_a_message
=
false
;
entry_index
=
0
;
rr
.
length
=
6
;
rr
.
buffers
=
{
{
"GEORADIUS"
},
{
""
},
{
"123.4"
},
{
"56.78"
},
{
"100"
},
{
"m"
}};
rr
.
buffers
=
{{
"GEORADIUS"
},
{
""
},
{
"123.4"
},
{
"56.78"
},
{
"100"
},
{
"m"
}};
const
char
*
request_data
=
"*6
\r\n
$9
\r\n
GEORADIUS
\r\n
$0
\r\n\r\n
$5
\r\n
123.4
\r\n
$5
\r\n
56."
"78
\r\n
$3
\r\n
100
\r\n
$1
\r\n
m
\r\n
"
;
...
...
@@ -130,8 +129,7 @@ public:
got_a_message
=
false
;
entry_index
=
0
;
rr
.
length
=
5
;
rr
.
buffers
=
{
{
"GEORADIUSBYMEMBER"
},
{
""
},
{
"member1"
},
{
"1000.5"
},
{
"km"
}};
rr
.
buffers
=
{{
"GEORADIUSBYMEMBER"
},
{
""
},
{
"member1"
},
{
"1000.5"
},
{
"km"
}};
const
char
*
request_data
=
"*5
\r\n
$17
\r\n
GEORADIUSBYMEMBER
\r\n
$0
\r\n\r\n
$"
"7
\r\n
member1
\r\n
$6
\r\n
1000.5
\r\n
$2
\r\n
km
\r\n
"
;
...
...
src/server/test/pegasus_compression_options_test.cpp
浏览文件 @
3242f091
...
...
@@ -133,8 +133,7 @@ TEST_F(pegasus_compression_options_test, compression_types_convert_fail)
TEST_F
(
pegasus_compression_options_test
,
check_rocksdb_compression_types_default
)
{
start
();
check_db_compression_types
({
none
,
none
,
lz4
,
lz4
,
lz4
,
lz4
},
"start with default"
);
check_db_compression_types
({
none
,
none
,
lz4
,
lz4
,
lz4
,
lz4
},
"start with default"
);
}
}
// namespace server
...
...
src/shell/commands/data_operations.cpp
浏览文件 @
3242f091
...
...
@@ -2548,19 +2548,23 @@ print_current_scan_state(const std::vector<std::unique_ptr<scan_data_context>> &
fprintf
(
stderr
,
"
\n
============================[hash_key_size]============================
\n
"
"%s======================================================================="
,
statistics
->
getHistogramString
(
static_cast
<
uint32_t
>
(
histogram_type
::
HASH_KEY_SIZE
)).
c_str
());
statistics
->
getHistogramString
(
static_cast
<
uint32_t
>
(
histogram_type
::
HASH_KEY_SIZE
))
.
c_str
());
fprintf
(
stderr
,
"
\n
============================[sort_key_size]============================
\n
"
"%s======================================================================="
,
statistics
->
getHistogramString
(
static_cast
<
uint32_t
>
(
histogram_type
::
SORT_KEY_SIZE
)).
c_str
());
statistics
->
getHistogramString
(
static_cast
<
uint32_t
>
(
histogram_type
::
SORT_KEY_SIZE
))
.
c_str
());
fprintf
(
stderr
,
"
\n
==============================[value_size]=============================
\n
"
"%s======================================================================="
,
statistics
->
getHistogramString
(
static_cast
<
uint32_t
>
(
histogram_type
::
VALUE_SIZE
)).
c_str
());
statistics
->
getHistogramString
(
static_cast
<
uint32_t
>
(
histogram_type
::
VALUE_SIZE
))
.
c_str
());
fprintf
(
stderr
,
"
\n
===============================[row_size]==============================
\n
"
"%s=======================================================================
\n\n
"
,
statistics
->
getHistogramString
(
static_cast
<
uint32_t
>
(
histogram_type
::
ROW_SIZE
)).
c_str
());
statistics
->
getHistogramString
(
static_cast
<
uint32_t
>
(
histogram_type
::
ROW_SIZE
))
.
c_str
());
}
}
...
...
src/test/function_test/test_recovery.cpp
浏览文件 @
3242f091
...
...
@@ -42,8 +42,7 @@ protected:
system
(
"sed -i
\"
/^perf_counter_enable_logging/c perf_counter_enable_logging = false
\"
"
"config-server-test-recovery.ini"
);
system
(
"./run.sh start_onebox -m 1 -r 3 --config_path config-server-test-recovery.ini"
);
system
(
"./run.sh start_onebox -m 1 -r 3 --config_path config-server-test-recovery.ini"
);
std
::
cout
<<
"sleep for a while to wait the new onebox start"
<<
std
::
endl
;
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
seconds
(
3
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录