未验证 提交 6d0e4e4a 编写于 作者: S Sing_chan 提交者: GitHub

【CI】run all demo ci before exit in windows (#42700)

* run all demo ci before exit;test=document_fix;test=windows_ci_inference

* fix bug;test=document_fix;test=windows_ci_inference

* improve log

* commetn test code

* modify according to zhouwei's comments
上级 4427f1b1
......@@ -106,6 +106,9 @@ mkdir -p build
cd build
rm -rf *
# run all test cases before exit
EXIT_CODE=0
for WITH_STATIC_LIB in ON OFF; do
if [ $(echo `uname` | grep "Win") != "" ]; then
# TODO(wilber, T8T9): Do we still need to support windows gpu static library
......@@ -128,8 +131,8 @@ for WITH_STATIC_LIB in ON OFF; do
--dirname=$DATA_DIR/word2vec/word2vec.inference.model \
--use_gpu=$use_gpu
if [ $? -ne 0 ]; then
echo "simple_on_word2vec demo runs fail."
exit 1
echo "simple_on_word2vec use_gpu:${use_gpu} runs failed " > ${current_dir}/test_summary.txt
EXIT_CODE=1
fi
done
......@@ -153,8 +156,8 @@ for WITH_STATIC_LIB in ON OFF; do
--refer=$DATA_DIR/$vis_demo_name/result.txt \
--use_gpu=$use_gpu
if [ $? -ne 0 ]; then
echo "vis demo $vis_demo_name runs fail."
exit 1
echo "vis demo $vis_demo_name use_gpu:${use_gpu} runs failed " >> ${current_dir}/test_summary.txt
EXIT_CODE=1
fi
done
done
......@@ -179,8 +182,8 @@ for WITH_STATIC_LIB in ON OFF; do
--data=$DATA_DIR/mobilenet/data.txt \
--refer=$DATA_DIR/mobilenet/result.txt
if [ $? -ne 0 ]; then
echo "trt demo trt_mobilenet_demo runs fail."
exit 1
echo "trt_mobilenet_demo runs failed." >> ${current_dir}/test_summary.txt
EXIT_CODE=1
fi
fi
else
......@@ -200,8 +203,8 @@ for WITH_STATIC_LIB in ON OFF; do
--dirname=$DATA_DIR/word2vec/word2vec.inference.model \
--use_gpu=$use_gpu
if [ $? -ne 0 ]; then
echo "simple_on_word2vec demo runs fail."
exit 1
echo "simple_on_word2vec use_gpu:${use_gpu} runs failed " >> ${current_dir}/test_summary.txt
EXIT_CODE=1
fi
done
fi
......@@ -222,8 +225,8 @@ for WITH_STATIC_LIB in ON OFF; do
--refer=$DATA_DIR/$vis_demo_name/result.txt \
--use_gpu=$use_gpu
if [ $? -ne 0 ]; then
echo "vis demo $vis_demo_name runs fail."
exit 1
echo "vis demo $vis_demo_name use_gpu:${use_gpu} runs failed " >> ${current_dir}/test_summary.txt
EXIT_CODE=1
fi
done
done
......@@ -244,8 +247,8 @@ for WITH_STATIC_LIB in ON OFF; do
--data=$DATA_DIR/mobilenet/data.txt \
--refer=$DATA_DIR/mobilenet/result.txt
if [ $? -ne 0 ]; then
echo "trt demo trt_mobilenet_demo runs fail."
exit 1
echo "trt_mobilenet_demo runs failed " >> ${current_dir}/test_summary.txt
EXIT_CODE=1
fi
fi
......@@ -264,10 +267,25 @@ for WITH_STATIC_LIB in ON OFF; do
./onnxruntime_mobilenet_demo \
--modeldir=$DATA_DIR/MobileNetV2/MobileNetV2
if [ $? -ne 0 ]; then
echo "onnxruntime demo onnxruntime_mobilenet_demo runs fail."
exit 1
echo "onnxruntime_mobilenet_demo runs failed " >> ${current_dir}/test_summary.txt
EXIT_CODE=1
fi
fi
fi
done
set +x
if [[ -f ${current_dir}/test_summary.txt ]];then
echo " "
echo "Summary demo_ci Failed Tests ..."
echo "=====================test summary======================"
echo "The following tests Failed: "
cat ${current_dir}/test_summary.txt
echo "========================================================"
echo " "
fi
set -x
exit ${EXIT_CODE}
......@@ -309,7 +309,7 @@ echo " "
if [[ -f ${exe_dir}/test_summary.txt ]];then
echo " "
echo "Summary Failed Tests ..."
echo "Summary infer_ut Failed Tests ..."
echo "=====================test summary======================"
echo "The following tests Failed: "
cat ${exe_dir}/test_summary.txt
......
......@@ -304,10 +304,14 @@ if %errorlevel% NEQ 0 exit /b 1
call :cmake || goto cmake_error
call :build || goto build_error
call :test_inference || goto test_inference_error
call :test_inference_ut || goto test_inference_ut_error
call :test_inference
if %errorlevel% NEQ 0 set error_code=%errorlevel%
call :test_inference_ut
if %errorlevel% NEQ 0 set error_code=%errorlevel%
call :zip_cc_file || goto zip_cc_file_error
call :zip_c_file || goto zip_c_file_error
if %error_code% NEQ 0 goto test_inference_error
goto:success
rem "Other configurations are added here"
......@@ -759,12 +763,15 @@ for /F %%i in ("%libsize%") do (
cd /d %work_dir%\paddle\fluid\inference\api\demo_ci
%cache_dir%\tools\busybox64.exe bash run.sh %work_dir:\=/% %WITH_MKL% %WITH_GPU% %cache_dir:\=/%/inference_demo %WITH_TENSORRT% %TENSORRT_ROOT% %WITH_ONNXRUNTIME% %MSVC_STATIC_CRT% "%CUDA_TOOLKIT_ROOT_DIR%"
goto:eof
:test_inference_error
::echo 1 > %cache_dir%\error_code.txt
::type %cache_dir%\error_code.txt
echo Testing fluid library for inference failed!
echo ==========================================
echo Testing inference library failed!
echo ==========================================
exit /b 1
rem ---------------------------------------------------------------------------------------------
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册