From d20349b548da26200aad0110d7a5ed7b678a9f5c Mon Sep 17 00:00:00 2001 From: Zhou Wei <52485244+zhouwei25@users.noreply.github.com> Date: Thu, 24 Sep 2020 22:14:25 +0800 Subject: [PATCH] add unittest count ,install check on windows (#27492) * add unittest count of windows * Reduce the number of retries --- cmake/generic.cmake | 1 + paddle/scripts/installation_validate.py | 1 + paddle/scripts/paddle_build.bat | 17 ++++++++++------- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/cmake/generic.cmake b/cmake/generic.cmake index 3bdf7c209b..a238626536 100644 --- a/cmake/generic.cmake +++ b/cmake/generic.cmake @@ -721,6 +721,7 @@ function(proto_library TARGET_NAME) set(proto_hdrs) paddle_protobuf_generate_cpp(proto_srcs proto_hdrs ${proto_library_SRCS}) cc_library(${TARGET_NAME} SRCS ${proto_srcs} DEPS ${proto_library_DEPS} protobuf) + add_dependencies(extern_xxhash ${TARGET_NAME}) endfunction() function(py_proto_compile TARGET_NAME) diff --git a/paddle/scripts/installation_validate.py b/paddle/scripts/installation_validate.py index f84e2f4b17..b765291a3b 100644 --- a/paddle/scripts/installation_validate.py +++ b/paddle/scripts/installation_validate.py @@ -15,4 +15,5 @@ import paddle.fluid as fluid import paddle as pd +fluid.install_check.run_check() print(pd.__version__) diff --git a/paddle/scripts/paddle_build.bat b/paddle/scripts/paddle_build.bat index 524c086c07..7ad2787d18 100644 --- a/paddle/scripts/paddle_build.bat +++ b/paddle/scripts/paddle_build.bat @@ -40,6 +40,7 @@ if not defined WITH_TPCACHE set WITH_TPCACHE=ON rem -------set cache build work directory----------- +rmdir build\python /s/q if "%WITH_CACHE%"=="OFF" ( rmdir build /s/q goto :mkbuild @@ -48,10 +49,10 @@ if "%WITH_CACHE%"=="OFF" ( for /F %%# in ('wmic os get localdatetime^|findstr 20') do set datetime=%%# set day_now=%datetime:~6,2% set day_before=-1 -set /p day_before= day.txt - type day.txt + echo %day_now% > %work_dir%\..\day.txt + type %work_dir%\..\day.txt rmdir build /s/q ) git diff origin/develop --stat --name-only | findstr "cmake CMakeLists.txt paddle_build.bat" @@ -208,7 +209,7 @@ echo Build third_party the %build_times% time: msbuild /m /p:Configuration=Release /verbosity:quiet third_party.vcxproj if %ERRORLEVEL% NEQ 0 ( set /a build_times=%build_times%+1 - if %build_times% GTR 3 ( + if %build_times% GTR 2 ( exit /b 7 ) else ( echo Build third_party failed, will retry! @@ -223,7 +224,7 @@ echo Build Paddle the %build_times% time: msbuild /m:%PARALLEL_PROJECT_COUNT% /p:TrackFileAccess=false /p:CLToolExe=clcache.exe /p:CLToolPath=%PYTHON_ROOT%\Scripts /p:Configuration=Release /verbosity:minimal paddle.sln if %ERRORLEVEL% NEQ 0 ( set /a build_times=%build_times%+1 - if %build_times% GTR 2 ( + if %build_times% GTR 1 ( exit /b 7 ) else ( echo Build Paddle failed, will retry! @@ -301,6 +302,7 @@ goto:eof call paddle_winci\Scripts\deactivate.bat 2>NUL for /F %%# in ('wmic os get localdatetime^|findstr 20') do set end=%%# set end=%end:~4,10% +call :timestamp "%start%" "%end%" "1 card TestCases Total" call :timestamp "%start%" "%end%" "TestCases Total" echo Running unit tests failed, will exit! exit /b 8 @@ -313,6 +315,7 @@ echo ======================================== for /F %%# in ('wmic os get localdatetime^|findstr 20') do set end=%%# set end=%end:~4,10% +call :timestamp "%start%" "%end%" "1 card TestCases Total" call :timestamp "%start%" "%end%" "TestCases Total" cd %work_dir%\paddle\fluid\inference\api\demo_ci @@ -345,6 +348,8 @@ echo ============================================ >> check_change_of_unitte echo EOF>> check_change_of_unittest.sh echo spec_path=$(pwd)/UNITTEST_PR.spec>> check_change_of_unittest.sh echo ctest -N ^| awk -F ':' '{print $2}' ^| sed '/^^$/d' ^| sed '$d' ^> ${spec_path}>> check_change_of_unittest.sh +echo num=$(awk 'END{print NR}' ${spec_path})>> check_change_of_unittest.sh +echo echo "Windows 1 card TestCases count is $num">> check_change_of_unittest.sh echo UPSTREAM_URL='https://github.com/PaddlePaddle/Paddle'>> check_change_of_unittest.sh echo origin_upstream_url=`git remote -v ^| awk '{print $1, $2}' ^| uniq ^| grep upstream ^| awk '{print $2}'`>> check_change_of_unittest.sh echo if [ "$origin_upstream_url" == "" ]; then>> check_change_of_unittest.sh @@ -455,8 +460,6 @@ taskkill /f /im cvtres.exe 2>NUL taskkill /f /im rc.exe 2>NUL wmic process where name="op_function_generator.exe" call terminate 2>NUL taskkill /f /im python.exe 2>NUL -call paddle_winci\Scripts\deactivate.bat 2>NUL -del %PADDLE_WHL_FILE_WIN% taskkill /f /im python.exe 2>NUL echo Windows CI run successfully! exit /b 0 -- GitLab