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