Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
34670596
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
34670596
编写于
12月 06, 2019
作者:
Z
zhouwei25
提交者:
liuwei1031
12月 06, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
monitoring changes of unittest, delete one unittest will need approve (#21377)
上级
97e76cb9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
88 addition
and
1 deletion
+88
-1
paddle/scripts/paddle_build.sh
paddle/scripts/paddle_build.sh
+56
-0
tools/check_api_approvals.sh
tools/check_api_approvals.sh
+1
-1
tools/diff_unittest.py
tools/diff_unittest.py
+31
-0
未找到文件。
paddle/scripts/paddle_build.sh
浏览文件 @
34670596
...
...
@@ -506,6 +506,57 @@ function generate_api_spec() {
deactivate
}
function
check_change_of_unittest
()
{
fetch_upstream_develop_if_not_exist
cur_branch
=
`
git branch |
grep
\*
|
cut
-d
' '
-f2
`
git checkout
-b
develop_base_pr upstream/
$BRANCH
cmake_gen
$1
generate_unittest_spec
"DEV"
git checkout
$cur_branch
git branch
-D
develop_base_pr
rm
-rf
${
PADDLE_ROOT
}
/build
cmake_gen
$1
generate_unittest_spec
"PR"
# approval_user_list: XiaoguangHu01 46782768,luotao1 6836917,phlrain 43953930,lanxianghit 47554610, zhouwei25 52485244
approval_line
=
`
curl
-H
"Authorization: token
${
GITHUB_API_TOKEN
}
"
https://api.github.com/repos/PaddlePaddle/Paddle/pulls/
${
GIT_PR_ID
}
/reviews?per_page
=
10000
`
tests_spec_diff
=
`
python
${
PADDLE_ROOT
}
/tools/diff_unittest.py
${
PADDLE_ROOT
}
/paddle/fluid/UNITTEST_DEV.spec
${
PADDLE_ROOT
}
/paddle/fluid/UNITTEST_PR.spec
`
if
[
"
$test_spec_diff
"
!=
""
]
;
then
APPROVALS
=
`
echo
${
approval_line
}
|python
${
PADDLE_ROOT
}
/tools/check_pr_approval.py 1 46782768 6836917 43953930 47554610
`
echo
"current pr
${
GIT_PR_ID
}
got approvals:
${
APPROVALS
}
"
if
[
"
${
APPROVALS
}
"
==
"FALSE"
]
;
then
echo
"****************"
echo
-e
"You must have one RD (luotao1 or XiaoguangHu01 or phlrain or lanxianghit or zhouwei25) approval for the deletion of unit tests.
\n
"
echo
"There are one approved errors."
echo
"****************"
exit
1
fi
fi
ENABLE_MAKE_CLEAN
=
"OFF"
}
function
generate_unittest_spec
()
{
spec_kind
=
$1
if
[
"
$spec_kind
"
==
"DEV"
]
;
then
cat
<<
EOF
============================================================
Complete cmake first time to get number of unit tests in develop.
============================================================
EOF
elif
[
"
$spec_kind
"
==
"PR"
]
;
then
cat
<<
EOF
============================================================
Complete cmake second time to get number of unit tests in this PR.
============================================================
EOF
else
echo
"Not supported
$1
"
exit
1
fi
spec_path
=
${
PADDLE_ROOT
}
/paddle/fluid/UNITTEST_
${
spec_kind
}
.spec
ctest
-N
|
awk
-F
':'
'{print $2}'
|
sed
'/^$/d'
|
sed
'$d'
>
${
spec_path
}
}
function
assert_api_spec_approvals
()
{
/bin/bash
${
PADDLE_ROOT
}
/tools/check_api_approvals.sh
...
...
@@ -1111,6 +1162,11 @@ function main() {
build_mac
run_mac_test
${
PYTHON_ABI
:-
""
}
${
PROC_RUN
:-
1
}
;;
maccheck_py35
)
check_change_of_unittest
${
PYTHON_ABI
:-
""
}
build_mac
run_mac_test
${
PYTHON_ABI
:-
""
}
${
PROC_RUN
:-
1
}
;;
macbuild
)
cmake_gen
${
PYTHON_ABI
:-
""
}
build_mac
...
...
tools/check_api_approvals.sh
浏览文件 @
34670596
...
...
@@ -78,7 +78,7 @@ for API_FILE in ${API_FILES[*]}; do
echo
"checking
${
API_FILE
}
change, PR:
${
GIT_PR_ID
}
, changes:
${
API_CHANGE
}
"
if
[
"
${
API_CHANGE
}
"
]
&&
[
"
${
GIT_PR_ID
}
"
!=
""
]
;
then
# NOTE: per_page=10000 should be ok for all cases, a PR review > 10000 is not human readable.q
# approval_user_list: XiaoguangHu01 46782768,Xreki 12538138,luotao1 6836917,sneaxiy 32832641,qingqing01 7845005,guoshengCS 14105589,heavengate 12605721,kuke 3064195,Superjomn 328693,lanxianghit 47554610,cyj1986 39645414,hutuxian 11195205,frankwhzhang 20274488,nepeplwu 45024560,Dianhai 38231817,JiabinYang 22361972,chenwhql 22561442,zhiqiu 6888866,seiriosPlus 5442383,gongweibao 10721757,saxon-zh 2870059,Boyan-Liu 2870059, Aurelius84 9301846, liym27 33742067, zhhsplendid 7913861.
# approval_user_list: XiaoguangHu01 46782768,Xreki 12538138,luotao1 6836917,sneaxiy 32832641,qingqing01 7845005,guoshengCS 14105589,heavengate 12605721,kuke 3064195,Superjomn 328693,lanxianghit 47554610,cyj1986 39645414,hutuxian 11195205,frankwhzhang 20274488,nepeplwu 45024560,Dianhai 38231817,JiabinYang 22361972,chenwhql 22561442,zhiqiu 6888866,seiriosPlus 5442383,gongweibao 10721757,saxon-zh 2870059,Boyan-Liu 2870059,
zhouwei25 52485244,
Aurelius84 9301846, liym27 33742067, zhhsplendid 7913861.
if
[
"
${
API_FILE
}
"
==
"paddle/fluid/op_use_default_grad_op_maker.spec"
]
;
then
echo_line
=
"You must have one RD (sneaxiy (Recommend) or luotao1) approval for op_use_default_grad_op_maker.spec, which manages the grad_op memory optimization.
\n
"
check_approval 1 32832641 6836917
...
...
tools/diff_unittest.py
0 → 100644
浏览文件 @
34670596
#!/usr/bin/env python
import
difflib
import
sys
with
open
(
sys
.
argv
[
1
],
'r'
)
as
f
:
origin
=
f
.
read
()
origin
=
origin
.
splitlines
()
with
open
(
sys
.
argv
[
2
],
'r'
)
as
f
:
new
=
f
.
read
()
new
=
new
.
splitlines
()
differ
=
difflib
.
Differ
()
result
=
differ
.
compare
(
origin
,
new
)
error
=
False
diffs
=
[]
for
each_diff
in
result
:
if
each_diff
[
0
]
==
'-'
:
# delete unit test is not allowed
error
=
True
diffs
.
append
(
each_diff
)
'''
If you delete the unit test, such as commenting it out,
please ask for approval of one RD below for passing CI:
- XiaoguangHu01 or luotao1 or phlrain or lanxianghit or zhouwei25
'''
if
error
:
print
(
'Deleted Unit test is: '
)
for
each_diff
in
diffs
:
print
(
each_diff
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录