Skip to content

Commit 78ee064

Browse files
authored
Fix pytest not found (#6129)
* [CI] fix examples api names bug * fix pytest not found * fix pytest not found
1 parent 8c9717a commit 78ee064

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scripts/regression/run_ci.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ mkdir /workspace/PaddleNLP/unittest_logs
2929
mkdir /workspace/PaddleNLP/coverage_logs
3030
mkdir /workspace/PaddleNLP/upload
3131
export log_path=/workspace/PaddleNLP/model_logs
32+
export LD_LIBRARY_PATH=/opt/_internal/cpython-3.7.0/lib/:${LD_LIBRARY_PATH}
33+
export PATH=/opt/_internal/cpython-3.7.0/bin/:${PATH}
3234
export P0case_list=()
3335
export APIcase_list=()
3436
declare -A Normal_dic
@@ -127,7 +129,7 @@ for file_name in `git diff --numstat origin |awk '{print $NF}'`;do
127129
elif [[ ${!all_P0case_dic[*]} =~ ${dir2} ]];then
128130
P0case_list[${#P0case_list[*]}]=${dir2}
129131
elif [[ ${dir2} =~ "transformers" ]];then
130-
P0case_list[${#P0case_list[*]}]=transformers
132+
# P0case_list[${#P0case_list[*]}]=transformers
131133
if [[ ${!all_P0case_dic[*]} =~ ${dir3} ]];then
132134
P0case_list[${#P0case_list[*]}]=${dir3}
133135
fi
@@ -251,9 +253,9 @@ if [[ ${#P0case_list[*]} -ne 0 ]] || [[ ${#APIcase_list[*]} -ne 0 ]];then
251253
echo -e "\033[35m ---- unittest length: ${#APIcase_list[*]}, unittest cases: ${APIcase_list[*]} \033[0m"
252254
for apicase in ${APIcase_list[*]};do
253255
if [[ ${apicase} =~ "taskflow" ]] ; then
254-
pytest tests/taskflow/test_*.py >${nlp_dir}/unittest_logs/${apicase}_unittest.log 2>&1
256+
python -m pytest tests/taskflow/test_*.py >${nlp_dir}/unittest_logs/${apicase}_unittest.log 2>&1
255257
else
256-
pytest tests/transformers/${apicase}/test_*.py >${nlp_dir}/unittest_logs/${apicase}_unittest.log 2>&1
258+
python -m pytest tests/transformers/${apicase}/test_*.py >${nlp_dir}/unittest_logs/${apicase}_unittest.log 2>&1
257259
# sh run_coverage.sh paddlenlp.transformers.${apicase} >unittest_logs/${apicase}_coverage.log 2>&1
258260
fi
259261
UT_EXCODE=$? || true

0 commit comments

Comments
 (0)