未验证 提交 2f76ddd7 编写于 作者: R risemeup1 提交者: GitHub

check change of unittest before checking coverage rate,test=coverage (#46593)

* check change of unittest before checking coverage rate,test=coverage

* modify paddle_build.sh

* adding test_list.py
上级 bd10211c
......@@ -678,6 +678,7 @@ EOF
echo "========================================="
fi
bash $PADDLE_ROOT/tools/check_added_ut.sh
check_approvals_of_unittest 2
get_precision_ut_mac
if [[ "$on_precision" == "0" ]];then
ctest -E "($disable_ut_quickly)" -LE ${nightly_label} --output-on-failure -j $2 | tee $tmpfile
......@@ -1152,36 +1153,12 @@ function check_diff_file_for_coverage() {
export PADDLE_GIT_DIFF_PY_FILE=${diff_py_file%*,}
}
function check_change_of_unittest() {
generate_unittest_spec "PR"
check_approvals_of_unittest 2
}
function check_sequence_op_unittest(){
/bin/bash ${PADDLE_ROOT}/tools/check_sequence_op.sh
}
function generate_unittest_spec() {
spec_kind=$1
if [ "$spec_kind" == "DEV" ]; then
cat <<EOF
============================================
Generate unit tests.spec of develop.
============================================
EOF
elif [ "$spec_kind" == "PR" ]; then
cat <<EOF
============================================
Generate unit tests.spec of 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() {
......@@ -2510,6 +2487,8 @@ set -x
export TEST_NUM_PERCENT_CASES=0.15
precison_cases=""
bash $PADDLE_ROOT/tools/check_added_ut.sh
#check change of pr_unnitests and dev_unnitests
check_approvals_of_unittest 2
if [ ${PRECISION_TEST:-OFF} == "ON" ]; then
python3.7 $PADDLE_ROOT/tools/get_pr_ut.py
fi
......@@ -3552,7 +3531,6 @@ function main() {
enable_unused_var_check
parallel_test
check_coverage
check_change_of_unittest ${PYTHON_ABI:-""}
;;
cpu_cicheck_coverage)
check_diff_file_for_coverage
......@@ -3563,7 +3541,6 @@ function main() {
gpu_cicheck_coverage)
parallel_test
check_coverage
check_change_of_unittest ${PYTHON_ABI:-""}
;;
check_coverage_build)
check_coverage_build
......@@ -3626,7 +3603,6 @@ function main() {
maccheck_py35)
cmake_gen_and_build_mac ${PYTHON_ABI:-""}
run_mac_test ${PYTHON_ABI:-""} ${PROC_RUN:-1}
check_change_of_unittest ${PYTHON_ABI:-""}
;;
macbuild)
cmake_gen ${PYTHON_ABI:-""}
......
......@@ -54,9 +54,11 @@ fi
# remove line ended with .exe to get correct deleted_ut list
ctest -N | awk -F ':' '{print $2}' | sed '/^$/d' | sed '$d' | sed 's/ //g' | sed '/\.exe$/d' | grep 'test' > $PADDLE_ROOT/br-ut
#UNITTEST_DEV.spec is used for checking changes of unnitests between pr and paddle_develop in the later step
spec_path=${PADDLE_ROOT}/paddle/fluid/UNITTEST_DEV.spec
ctest -N | awk -F ':' '{print $2}' | sed '/^$/d' | sed '$d' > ${spec_path}
spec_path_dev=${PADDLE_ROOT}/paddle/fluid/UNITTEST_DEV.spec
ctest -N | awk -F ':' '{print $2}' | sed '/^$/d' | sed '$d' > ${spec_path_dev}
cd $PADDLE_ROOT/build
spec_path_pr=${PADDLE_ROOT}/paddle/fluid/UNITTEST_PR.spec
ctest -N | awk -F ':' '{print $2}' | sed '/^$/d' | sed '$d' > ${spec_path_pr}
ctest -N | awk -F ':' '{print $2}' | sed '/^$/d' | sed '$d' | sed 's/ //g' | sed '/\.exe$/d' | grep 'test' > $PADDLE_ROOT/pr-ut
cd $PADDLE_ROOT
grep -F -x -v -f br-ut pr-ut > $PADDLE_ROOT/added_ut
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册