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

Fix bug (#47621)

* 修改.gitigore文件,把ljd_sh文件忽略掉

* 取消ljd_sh文件忽略

* fix ci bug

* fix windows ci bug

* fix bug ci

* fix bug test

* fix bug test
上级 1568d64f
......@@ -2539,6 +2539,7 @@ set -x
bash $PADDLE_ROOT/tools/check_added_ut.sh
#check change of pr_unnitests and dev_unnitests
check_approvals_of_unittest 2
ctest -N | awk -F ': ' '{print $2}' | sed '/^$/d' | sed '$d' > ${PADDLE_ROOT}/build/all_ut_list
if [ ${PRECISION_TEST:-OFF} == "ON" ]; then
python3.7 $PADDLE_ROOT/tools/get_pr_ut.py
fi
......@@ -2571,7 +2572,6 @@ set +x
mkdir -p ${PADDLE_ROOT}/build/Testing/Temporary/
cp -r ${PADDLE_ROOT}/build/CTestCostData.txt ${PADDLE_ROOT}/build/Testing/Temporary/
ctest -N | awk -F ': ' '{print $2}' | sed '/^$/d' | sed '$d' > all_ut_list
get_quickly_disable_ut||disable_ut_quickly='disable_ut' # indicate whether the case was in quickly disable list
test_cases=$(ctest -N -V) # get all test cases
......
......@@ -280,11 +280,12 @@ class PRChecker(object):
def file_is_unnit_test(self, unittest_path):
# get all testcases by ctest-N
all_ut_file = '%s/build/all_ut_file' % PADDLE_ROOT
os.system(
"cd %s/build && ctest -N | awk -F ': ' '{print $2}' | sed '/^$/d' | sed '$d' > %s"
% (PADDLE_ROOT, all_ut_file)
)
all_ut_file = PADDLE_ROOT + 'build/all_ut_list'
# all_ut_file = '%s/build/all_ut_file' % PADDLE_ROOT
print("PADDLE_ROOT:", PADDLE_ROOT)
print("all_ut_file path:", all_ut_file)
build_path = PADDLE_ROOT + 'build/'
print("build_path:", build_path)
(unittest_directory, unittest_name) = os.path.split(unittest_path)
# determine whether filename is in all_ut_case
with open(all_ut_file, 'r') as f:
......@@ -293,8 +294,7 @@ class PRChecker(object):
test = test.replace('\n', '').strip()
if test == unittest_name.split(".")[0]:
return True
else:
return False
return False
def get_pr_ut(self):
"""Get unit tests in pull request."""
......@@ -410,17 +410,17 @@ class PRChecker(object):
# determine whether the new added file is a member of added_ut
if file_dict[f] in ['added']:
f_judge_in_added_ut = False
with open(
'{}/added_ut'.format(PADDLE_ROOT)
) as utfile:
(filepath, tempfilename) = os.path.split(
f_judge
)
for f_file in utfile:
if (
f_file.strip('\n')
== tempfilename.split(".")[0]
):
path = PADDLE_ROOT + 'added_ut'
print("PADDLE_ROOT:", PADDLE_ROOT)
print("adde_ut path:", path)
(unittest_directory, unittest_name) = os.path.split(
f_judge
)
with open(path, 'r') as f:
added_unittests = f.readlines()
for test in added_unittests:
test = test.replace('\n', '').strip()
if test == unittest_name.split(".")[0]:
f_judge_in_added_ut = True
if f_judge_in_added_ut:
print(
......
......@@ -280,7 +280,7 @@ rm -rf $PADDLE_ROOT/tools/check_added_ut_win.sh
if [ -f "$PADDLE_ROOT/added_ut" ];then
added_uts=^$(awk BEGIN{RS=EOF}'{gsub(/\n/,"$|^");print}' $PADDLE_ROOT/added_ut)$
ctest -R "(${added_uts})" -E "${disable_win_inference_test}" --output-on-failure -C Release --repeat-until-fail 3;added_ut_error=$?
rm -f $PADDLE_ROOT/added_ut
#rm -f $PADDLE_ROOT/added_ut
if [ "$added_ut_error" != 0 ];then
echo "========================================"
echo "Added UT should pass three additional executions"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册