未验证 提交 07d089f6 编写于 作者: C chalsliu 提交者: GitHub

Check benchmark issues in CI

上级 5bd84b22
......@@ -287,12 +287,19 @@ fi
pip install PyGithub
# For getting PR related data
wget https://paddle-ci.gz.bcebos.com/blk/block.txt --no-check-certificate
wget https://sys-p0.bj.bcebos.com/bk-ci/bk.txt --no-check-certificate
HASUTFIXED=`python ${PADDLE_ROOT}/tools/check_ut.py | grep "has unit-test to be fixed" || true`
if [ "${HASUTFIXED}" != "" ]; then
echo_line="${HASUTFIXED} You must have one RD (chalsliu (Recommend) or kolinwei) approval.\n"
check_approval 1 45041955 22165420
fi
HASUTFIXED=`python ${PADDLE_ROOT}/tools/check_ut.py | grep "has benchmark issue to be fixed" || true`
if [ "${HASUTFIXED}" != "" ]; then
echo_line="${HASUTFIXED} You must have one RD (hysunflower or xiegegege or Xreki) approval.\n"
check_approval 1 52739577 46314656 12538138
fi
if [ -n "${echo_list}" ];then
echo "****************"
echo -e "${echo_list[@]}"
......
......@@ -27,9 +27,12 @@ class PRChecker(object):
self.github = Github(os.getenv('GITHUB_API_TOKEN'), timeout=60)
self.repo = None
def check(self):
""" check pr. """
filename = 'block.txt'
def check(self, filename, msg):
"""
Args:
filename (str): File to get block names.
msg (str): Error message.
"""
pr_id = os.getenv('GIT_PR_ID')
if not pr_id:
print('No PR ID')
......@@ -44,12 +47,10 @@ class PRChecker(object):
with open(filename) as f:
for l in f:
if l.rstrip('\r\n') == user:
print('{} has unit-test to be fixed, so CI failed.'.format(
user))
exit(1)
exit(0)
print('{} {}'.format(user, msg))
if __name__ == '__main__':
pr_checker = PRChecker()
pr_checker.check()
pr_checker.check('block.txt', 'has unit-test to be fixed, so CI failed.')
pr_checker.check('bk.txt', 'has benchmark issue to be fixed, so CI failed.')
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册