From 682ca642174b83c46d09292471ba8fccc283d738 Mon Sep 17 00:00:00 2001 From: Zhang Ting <709968123@qq.com> Date: Mon, 23 Dec 2019 23:44:40 +0800 Subject: [PATCH] approval for skip_check_grad_ci is required, test=develop (#21854) --- tools/check_api_approvals.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/check_api_approvals.sh b/tools/check_api_approvals.sh index 3a46c792ec..faedc75cc7 100644 --- a/tools/check_api_approvals.sh +++ b/tools/check_api_approvals.sh @@ -198,6 +198,22 @@ if [ "${NEW_OP_TEST_ADDED}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then fi fi +UNITTEST_FILE_CHANGED=`git diff --name-only --diff-filter=AM upstream/$BRANCH |grep -E "test_.*.\.py" || true` +if [ "${UNITTEST_FILE_CHANGED}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then + for TEST_FILE in ${UNITTEST_FILE_CHANGED}; + do + HAS_SKIP_CHECK_GRAD_CI=`git diff -U0 upstream/$BRANCH ${PADDLE_ROOT}/${TEST_FILE} |grep "@skip_check_grad_ci" || true` + if [ "${HAS_SKIP_CHECK_GRAD_CI}" != "" ]; then + ERROR_LINES="${ERROR_LINES}\n${TEST_FILE}\n${HAS_SKIP_CHECK_GRAD_CI}\n" + fi + done + if [ "${ERROR_LINES}" != "" ]; then + ERROR_LINES=${ERROR_LINES//+/'\n+\t'} + echo_line="You must have one RD (zhangting2020 (Recommend), luotao1 or phlrain) approval for the usage (either add or delete) of @skip_check_grad_ci. For more information, please refer to: https://github.com/PaddlePaddle/Paddle/wiki/Gradient-Check-Is-Required-for-Op-Test. The corresponding lines are as follows:\n${ERROR_LINES}\n" + check_approval 1 26615455 6836917 43953930 + fi +fi + if [ -n "${echo_list}" ];then echo "****************" echo -e "${echo_list[@]}" -- GitLab