From f663f34a48fa979f4ae01041229168593201c81f Mon Sep 17 00:00:00 2001 From: liu zhengxi <380185688@qq.com> Date: Thu, 5 Dec 2019 21:35:44 +0800 Subject: [PATCH] Add CI rule to check unittests inplace_atol (#21528) --- tools/check_api_approvals.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/check_api_approvals.sh b/tools/check_api_approvals.sh index c97fb796301..6a1be9b7e66 100644 --- a/tools/check_api_approvals.sh +++ b/tools/check_api_approvals.sh @@ -39,15 +39,14 @@ function check_approval(){ person_num=`echo $@|awk '{for (i=2;i<=NF;i++)print $i}'` APPROVALS=`echo ${approval_line}|python ${PADDLE_ROOT}/tools/check_pr_approval.py $1 $person_num` if [ "${APPROVALS}" == "FALSE" ]; then - add_failed $failed_num $echo_line + add_failed "${failed_num}. ${echo_line}" fi } function add_failed(){ failed_num=`expr $failed_num + 1` - add_line=`echo $@|awk '{for (i=2;i<=NF;i++)print $i}'` - echo_list=(${echo_list[@]}$1 "." $add_line) + echo_list="${echo_list[@]}$1" } @@ -147,6 +146,12 @@ if [ "${NEW_OP_ADDED}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then fi fi +HAS_INPLACE_TESTS=`git diff -U0 upstream/$BRANCH |grep "+" |grep -E "inplace_atol[[:space:]]*=.*" || true` +if [ "${HAS_INPLACE_TESTS}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then + echo_line="The calculation results of setting inplace enabled and disabled must be equal, that is, it's not recommended to set inplace_atol.\n If you do need to use inplace_atol, you must have one RD (XiaoguangHu01, lanxianghit, phlrain, luotao1) approval for the usage of inplace_atol.\nThe corresponding lines are as follows:\n${HAS_INPLACE_TESTS}\n" + check_approval 1 46782768 47554610 43953930 6836917 +fi + if [ -n "${echo_list}" ];then echo "****************" echo -e "${echo_list[@]}" -- GitLab