Skip to content

Commit

Permalink
delete test code (#4808) (#4946)
Browse files Browse the repository at this point in the history
  • Loading branch information
betterpig authored Jun 21, 2022
1 parent 1bf0b38 commit 0fe0cb1
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 26 deletions.
4 changes: 2 additions & 2 deletions ci_scripts/check_api_cn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ else
for file in $need_check_files;do
python chinese_samplecode_processor.py ../docs/$file
if [ $? -ne 0 ];then
echo "chinese sample code failed, the file is ${file}"
exit 5
EXIT_CODE=5
fi
done
exit ${EXIT_CODE}

#if [ "${need_check_cn_doc_files}" != "" ];then
# cd ../docs/paddle/api
Expand Down
4 changes: 3 additions & 1 deletion ci_scripts/check_code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ function check_style(){
fi
done
if [ $commit_files == 'off' ];then
echo "code format error"
echo "======================================================================="
echo "Code style check failed! Please check the error info above carefully."
echo "======================================================================="
exit 1
fi
trap 0
Expand Down
4 changes: 4 additions & 0 deletions ci_scripts/checkapproval.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ for API_FILE in ${API_FILES[*]}; do
fi
if [ "${APPROVALS}" == "FALSE" ]; then
if [ "${API_FILE}" == "docs/api/paddle" ];then
set +x
echo "=========================================================================================="
echo "You must have one TPM (jzhang533/ZhangJun or dingjiaweiww/DingJiaWei or TCChenlong/ChenLong or Ligoml/LiMengLiu) approval for the api change! ${API_FILE} for the management reason of API interface and API document."
echo "=========================================================================================="
set -x
fi
exit 1
fi
Expand Down
56 changes: 34 additions & 22 deletions ci_scripts/ci_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,7 @@ fi
export PADDLE_WHL
echo "PADDLE_WHL=${PADDLE_WHL}"

# 2 check code style/format.
/bin/bash ${DIR_PATH}/check_code.sh
if [ $? -ne 0 ];then
echo "code format error"
exit 1
fi

need_check_cn_doc_files=$(find_all_cn_api_files_modified_by_pr)
echo $need_check_cn_doc_files
# 3 Chinese api docs check
if [ "${need_check_cn_doc_files}" = "" ] ; then
echo "chinese api doc fileslist is empty, skip check."
else
/bin/bash -x ${DIR_PATH}/check_api_cn.sh "${need_check_cn_doc_files}"
if [ $? -ne 0 ];then
exit 1
fi
fi

# 4 build all the Chinese and English docs, and upload them. Controlled with Env BUILD_DOC and UPLOAD_DOC
# 2 build all the Chinese and English docs, and upload them. Controlled with Env BUILD_DOC and UPLOAD_DOC
PREVIEW_URL_PROMPT="ipipe_log_param_preview_url: None"
if [ "${BUILD_DOC}" = "true" ] && [ -x /usr/local/bin/sphinx-build ] ; then
export OUTPUTDIR=/docs
Expand Down Expand Up @@ -100,8 +81,10 @@ if [ "${BUILD_DOC}" = "true" ] && [ -x /usr/local/bin/sphinx-build ] ; then
fi
fi

if [ "${need_check_cn_doc_files}" = "" ] ; then
echo "chinese api doc fileslist is empty, skip check."
check_parameters=OFF
if [ "${check_parameters}" = "OFF" ] ; then
#echo "chinese api doc fileslist is empty, skip check."
echo "check_api_parameters is not stable, close it temporarily."
else
jsonfn=${OUTPUTDIR}/en/${VERSIONSTR}/gen_doc_output/api_info_all.json
if [ -f $jsonfn ] ; then
Expand All @@ -115,6 +98,35 @@ else
exit 1
fi
fi

EXIT_CODE=0
# 3 check code style/format.
/bin/bash ${DIR_PATH}/check_code.sh
if [ $? -ne 0 ];then
EXIT_CODE=1
fi

need_check_cn_doc_files=$(find_all_cn_api_files_modified_by_pr)
echo $need_check_cn_doc_files
# 4 Chinese api docs check
if [ "${need_check_cn_doc_files}" = "" ] ; then
echo "chinese api doc fileslist is empty, skip check."
else
/bin/bash -x ${DIR_PATH}/check_api_cn.sh "${need_check_cn_doc_files}"
if [ $? -ne 0 ];then
EXIT_CODE=1
fi
fi

if [ ${EXIT_CODE} -ne 0 ]; then
set +x
echo "=========================================================================================="
echo "Code style check or API Chinese doc check failed! Please check the error info above carefully."
echo "=========================================================================================="
set -x
exit ${EXIT_CODE}
fi

# 5 Approval check
/bin/bash ${DIR_PATH}/checkapproval.sh
if [ $? -ne 0 ];then
Expand Down
2 changes: 1 addition & 1 deletion ci_scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function get_paddle_pr_num_from_docs_pr_info(){
function install_paddle() {
# try to download paddle, and install
# PADDLE_WHL is defined in ci_start.sh
pip install --no-cache-dir -i https://mirror.baidu.com/pypi/simple ${PADDLE_WHL}
pip install --no-cache-dir -i https://mirror.baidu.com/pypi/simple ${PADDLE_WHL} 1>nul
# if failed, build paddle
if [ $? -ne 0 ];then
build_paddle
Expand Down

0 comments on commit 0fe0cb1

Please sign in to comment.