未验证 提交 3ed53280 编写于 作者: T tianshuo78520a 提交者: GitHub

Clean CI_SKIP_CPP_TEST (#44412)

上级 7daae985
...@@ -443,7 +443,7 @@ function(cc_binary TARGET_NAME) ...@@ -443,7 +443,7 @@ function(cc_binary TARGET_NAME)
endfunction() endfunction()
function(cc_test_build TARGET_NAME) function(cc_test_build TARGET_NAME)
if(WITH_TESTING AND NOT "$ENV{CI_SKIP_CPP_TEST}" STREQUAL "ON") if(WITH_TESTING)
set(oneValueArgs "") set(oneValueArgs "")
set(multiValueArgs SRCS DEPS) set(multiValueArgs SRCS DEPS)
cmake_parse_arguments(cc_test "${options}" "${oneValueArgs}" cmake_parse_arguments(cc_test "${options}" "${oneValueArgs}"
...@@ -484,7 +484,7 @@ function(cc_test_build TARGET_NAME) ...@@ -484,7 +484,7 @@ function(cc_test_build TARGET_NAME)
endfunction() endfunction()
function(cc_test_run TARGET_NAME) function(cc_test_run TARGET_NAME)
if(WITH_TESTING AND NOT "$ENV{CI_SKIP_CPP_TEST}" STREQUAL "ON") if(WITH_TESTING)
set(oneValueArgs "") set(oneValueArgs "")
set(multiValueArgs COMMAND ARGS) set(multiValueArgs COMMAND ARGS)
cmake_parse_arguments(cc_test "${options}" "${oneValueArgs}" cmake_parse_arguments(cc_test "${options}" "${oneValueArgs}"
...@@ -513,10 +513,7 @@ function(cc_test_run TARGET_NAME) ...@@ -513,10 +513,7 @@ function(cc_test_run TARGET_NAME)
endfunction() endfunction()
function(cc_test TARGET_NAME) function(cc_test TARGET_NAME)
# The environment variable `CI_SKIP_CPP_TEST` is used to skip the compilation if(WITH_TESTING)
# and execution of test in CI. `CI_SKIP_CPP_TEST` is set to ON when no files
# other than *.py are modified.
if(WITH_TESTING AND NOT "$ENV{CI_SKIP_CPP_TEST}" STREQUAL "ON")
set(oneValueArgs "") set(oneValueArgs "")
set(multiValueArgs SRCS DEPS ARGS) set(multiValueArgs SRCS DEPS ARGS)
cmake_parse_arguments(cc_test "${options}" "${oneValueArgs}" cmake_parse_arguments(cc_test "${options}" "${oneValueArgs}"
...@@ -617,12 +614,7 @@ function(nv_binary TARGET_NAME) ...@@ -617,12 +614,7 @@ function(nv_binary TARGET_NAME)
endfunction() endfunction()
function(nv_test TARGET_NAME) function(nv_test TARGET_NAME)
# The environment variable `CI_SKIP_CPP_TEST` is used to skip the compilation if(WITH_GPU AND WITH_TESTING)
# and execution of test in CI. `CI_SKIP_CPP_TEST` is set to ON when no files
# other than *.py are modified.
if(WITH_GPU
AND WITH_TESTING
AND NOT "$ENV{CI_SKIP_CPP_TEST}" STREQUAL "ON")
set(oneValueArgs "") set(oneValueArgs "")
set(multiValueArgs SRCS DEPS) set(multiValueArgs SRCS DEPS)
cmake_parse_arguments(nv_test "${options}" "${oneValueArgs}" cmake_parse_arguments(nv_test "${options}" "${oneValueArgs}"
...@@ -736,12 +728,7 @@ function(hip_binary TARGET_NAME) ...@@ -736,12 +728,7 @@ function(hip_binary TARGET_NAME)
endfunction() endfunction()
function(hip_test TARGET_NAME) function(hip_test TARGET_NAME)
# The environment variable `CI_SKIP_CPP_TEST` is used to skip the compilation if(WITH_ROCM AND WITH_TESTING)
# and execution of test in CI. `CI_SKIP_CPP_TEST` is set to ON when no files
# other than *.py are modified.
if(WITH_ROCM
AND WITH_TESTING
AND NOT "$ENV{CI_SKIP_CPP_TEST}" STREQUAL "ON")
set(oneValueArgs "") set(oneValueArgs "")
set(multiValueArgs SRCS DEPS) set(multiValueArgs SRCS DEPS)
cmake_parse_arguments(hip_test "${options}" "${oneValueArgs}" cmake_parse_arguments(hip_test "${options}" "${oneValueArgs}"
...@@ -850,12 +837,7 @@ function(xpu_binary TARGET_NAME) ...@@ -850,12 +837,7 @@ function(xpu_binary TARGET_NAME)
endfunction() endfunction()
function(xpu_test TARGET_NAME) function(xpu_test TARGET_NAME)
# The environment variable `CI_SKIP_CPP_TEST` is used to skip the compilation if(WITH_XPU_KP AND WITH_TESTING)
# and execution of test in CI. `CI_SKIP_CPP_TEST` is set to ON when no files
# other than *.py are modified.
if(WITH_XPU_KP
AND WITH_TESTING
AND NOT "$ENV{CI_SKIP_CPP_TEST}" STREQUAL "ON")
set(oneValueArgs "") set(oneValueArgs "")
set(multiValueArgs SRCS DEPS) set(multiValueArgs SRCS DEPS)
cmake_parse_arguments(xpu_test "${options}" "${oneValueArgs}" cmake_parse_arguments(xpu_test "${options}" "${oneValueArgs}"
......
...@@ -62,8 +62,7 @@ cc_library( ...@@ -62,8 +62,7 @@ cc_library(
# skip win32 since wget is not installed by default on windows machine. # skip win32 since wget is not installed by default on windows machine.
if(WITH_GPU if(WITH_GPU
AND WITH_TESTING AND WITH_TESTING
AND NOT WIN32 AND NOT WIN32)
AND NOT "$ENV{CI_SKIP_CPP_TEST}" STREQUAL "ON")
add_custom_target( add_custom_target(
download_program download_program
COMMAND wget -nc https://paddle-ci.gz.bcebos.com/new_exec/lm_main_program COMMAND wget -nc https://paddle-ci.gz.bcebos.com/new_exec/lm_main_program
......
# If CI_SKIP_CPP_TEST=ON, there is no need to build and run these test.
if("$ENV{CI_SKIP_CPP_TEST}" STREQUAL "ON")
return()
endif()
# In Windows, c_api test link must link both 2 shared to avoid symbols redefinition, # In Windows, c_api test link must link both 2 shared to avoid symbols redefinition,
# in Linux, c_api test cant do like this or graph_to_program register more than once. # in Linux, c_api test cant do like this or graph_to_program register more than once.
# Both Windows and Linux can only use paddle_inference_c, but this will increase size # Both Windows and Linux can only use paddle_inference_c, but this will increase size
...@@ -329,7 +324,7 @@ if(NOT APPLE AND WITH_MKLML) ...@@ -329,7 +324,7 @@ if(NOT APPLE AND WITH_MKLML)
inference_analysis_api_test( inference_analysis_api_test(
test_analyzer_seq_pool1_profile ${SEQ_POOL1_INSTALL_DIR} test_analyzer_seq_pool1_profile ${SEQ_POOL1_INSTALL_DIR}
analyzer_seq_pool1_profile_tester.cc) analyzer_seq_pool1_profile_tester.cc)
if(NOT WIN32 AND NOT "$ENV{CI_SKIP_CPP_TEST}" STREQUAL "ON") if(NOT WIN32)
set_tests_properties(test_analyzer_seq_pool1_compare_determine set_tests_properties(test_analyzer_seq_pool1_compare_determine
PROPERTIES TIMEOUT 120) PROPERTIES TIMEOUT 120)
set_tests_properties(test_analyzer_seq_pool1 PROPERTIES TIMEOUT 120) set_tests_properties(test_analyzer_seq_pool1 PROPERTIES TIMEOUT 120)
......
...@@ -29,9 +29,7 @@ cc_library( ...@@ -29,9 +29,7 @@ cc_library(
DEPS jit_serializer jit_function_utils jit_serializer_utils DEPS jit_serializer jit_function_utils jit_serializer_utils
jit_compilation_unit jit_function_schema) jit_compilation_unit jit_function_schema)
if(WITH_TESTING if(WITH_TESTING AND NOT WIN32)
AND NOT WIN32
AND NOT "$ENV{CI_SKIP_CPP_TEST}" STREQUAL "ON")
add_custom_target( add_custom_target(
jit_download_program jit_download_program
COMMAND wget -nc -q COMMAND wget -nc -q
......
...@@ -71,9 +71,7 @@ if(WITH_TESTING AND TEST cuda_managed_memory_test) ...@@ -71,9 +71,7 @@ if(WITH_TESTING AND TEST cuda_managed_memory_test)
TIMEOUT 50) TIMEOUT 50)
endif() endif()
if(WITH_GPU if(WITH_GPU AND WITH_TESTING)
AND WITH_TESTING
AND NOT "$ENV{CI_SKIP_CPP_TEST}" STREQUAL "ON")
nv_test( nv_test(
get_base_ptr_test get_base_ptr_test
SRCS get_base_ptr_test.cu SRCS get_base_ptr_test.cu
......
...@@ -62,17 +62,6 @@ function init() { ...@@ -62,17 +62,6 @@ function init() {
# NOTE(chenweihang): For easy debugging, CI displays the C++ error stacktrace by default # NOTE(chenweihang): For easy debugging, CI displays the C++ error stacktrace by default
export FLAGS_call_stack_level=2 export FLAGS_call_stack_level=2
# set CI_SKIP_CPP_TEST if only *.py changed
# In order to avoid using in some CI(such as daily performance), the current
# branch must not be `${BRANCH}` which is usually develop.
if [ ${CI_SKIP_CPP_TEST:-ON} == "OFF" ];then
echo "CI_SKIP_CPP_TEST=OFF"
else
if [ "$(git branch | grep "^\*" | awk '{print $2}')" != "${BRANCH}" ]; then
git diff --name-only ${BRANCH} | grep -v "\.py$" || export CI_SKIP_CPP_TEST=ON
fi
fi
} }
function infrt_gen_and_build() { function infrt_gen_and_build() {
......
...@@ -659,9 +659,6 @@ echo ======================================== ...@@ -659,9 +659,6 @@ echo ========================================
echo Step 4. Running unit tests ... echo Step 4. Running unit tests ...
echo ======================================== echo ========================================
: set CI_SKIP_CPP_TEST if only *.py changed
git diff --name-only %BRANCH% | findstr /V "\.py" || set CI_SKIP_CPP_TEST=ON
pip install -r %work_dir%\python\unittest_py\requirements.txt pip install -r %work_dir%\python\unittest_py\requirements.txt
if %ERRORLEVEL% NEQ 0 ( if %ERRORLEVEL% NEQ 0 (
echo pip install unittest requirements.txt failed! echo pip install unittest requirements.txt failed!
......
...@@ -60,17 +60,6 @@ function init() { ...@@ -60,17 +60,6 @@ function init() {
# NOTE(chenweihang): For easy debugging, CI displays the C++ error stacktrace by default # NOTE(chenweihang): For easy debugging, CI displays the C++ error stacktrace by default
export FLAGS_call_stack_level=2 export FLAGS_call_stack_level=2
# set CI_SKIP_CPP_TEST if only *.py changed
# In order to avoid using in some CI(such as daily performance), the current
# branch must not be `${BRANCH}` which is usually develop.
if [ ${CI_SKIP_CPP_TEST:-ON} == "OFF" ];then
echo "CI_SKIP_CPP_TEST=OFF"
else
if [ "$(git branch | grep "^\*" | awk '{print $2}')" != "${BRANCH}" ]; then
git diff --name-only ${BRANCH} | grep -v "\.py$" || export CI_SKIP_CPP_TEST=ON
fi
fi
} }
function cmake_base() { function cmake_base() {
...@@ -3232,7 +3221,6 @@ function reuse_so_cache() { ...@@ -3232,7 +3221,6 @@ function reuse_so_cache() {
down_proto_so=`echo $?` down_proto_so=`echo $?`
set -e set -e
if [ "${down_proto_so}" -eq 0 ];then if [ "${down_proto_so}" -eq 0 ];then
export CI_SKIP_CPP_TEST=ON
cd build && mv ../proto_so.tar.gz . cd build && mv ../proto_so.tar.gz .
tar --use-compress-program=pigz -xpf proto_so.tar.gz tar --use-compress-program=pigz -xpf proto_so.tar.gz
cmake_gen ${PYTHON_ABI:-""} ${parallel_number} cmake_gen ${PYTHON_ABI:-""} ${parallel_number}
......
...@@ -21,7 +21,6 @@ if [ -z ${BRANCH} ]; then ...@@ -21,7 +21,6 @@ if [ -z ${BRANCH} ]; then
BRANCH="develop" BRANCH="develop"
fi fi
export CI_SKIP_CPP_TEST=OFF
if [[ "$SYSTEM" == "Linux" ]] || [[ "$SYSTEM" == "Darwin" ]];then if [[ "$SYSTEM" == "Linux" ]] || [[ "$SYSTEM" == "Darwin" ]];then
PADDLE_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}")/../" && pwd )" PADDLE_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}")/../" && pwd )"
elif [[ "$SYSTEM" == "Windows_NT" ]];then elif [[ "$SYSTEM" == "Windows_NT" ]];then
...@@ -75,4 +74,3 @@ git checkout -f $CURBRANCH ...@@ -75,4 +74,3 @@ git checkout -f $CURBRANCH
echo $CURBRANCH echo $CURBRANCH
git branch -D prec_added_ut git branch -D prec_added_ut
cd $CURDIR cd $CURDIR
export CI_SKIP_CPP_TEST=
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册