未验证 提交 7896b51a 编写于 作者: W wuhuanzhou 提交者: GitHub

CI skip inference test if only python files modified (#32962)

* CI skip inference test if only python files modified, test=develop

* fix compilation error on ROCM, test=develop

* fix cmake error on PR-CI-ROCM-Compile, test=develop
上级 1e1600eb
......@@ -391,7 +391,7 @@ function(cc_binary TARGET_NAME)
endfunction(cc_binary)
function(cc_test_build TARGET_NAME)
if(WITH_TESTING)
if(WITH_TESTING AND NOT "$ENV{CI_SKIP_CPP_TEST}" STREQUAL "ON")
set(oneValueArgs "")
set(multiValueArgs SRCS DEPS)
cmake_parse_arguments(cc_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
......@@ -409,14 +409,12 @@ function(cc_test_build TARGET_NAME)
if(WITH_ROCM)
target_link_libraries(${TARGET_NAME} ${ROCM_HIPRTC_LIB})
endif()
check_coverage_opt(${TARGET_NAME} ${cc_test_SRCS})
endif()
check_coverage_opt(${TARGET_NAME} ${cc_test_SRCS})
endfunction()
function(cc_test_run TARGET_NAME)
if(WITH_TESTING)
if(WITH_TESTING AND NOT "$ENV{CI_SKIP_CPP_TEST}" STREQUAL "ON")
set(oneValueArgs "")
set(multiValueArgs COMMAND ARGS)
cmake_parse_arguments(cc_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
......
......@@ -71,7 +71,7 @@ elseif (WIN32)
cc_test(test_analysis_predictor SRCS analysis_predictor_tester.cc DEPS analysis_predictor benchmark ${inference_deps}
ARGS --dirname=${WORD2VEC_MODEL_DIR})
endif()
if(WITH_TESTING)
if(WITH_TESTING AND TEST test_api_impl)
if(NOT APPLE)
set_tests_properties(test_api_impl PROPERTIES TIMEOUT 120)
endif()
......
......@@ -242,10 +242,10 @@ download_result(${ERNIE_INSTALL_DIR} "Ernie_large_result.txt.tar.gz")
inference_analysis_test(test_analyzer_ernie_large SRCS analyzer_ernie_tester.cc
EXTRA_DEPS ${INFERENCE_EXTRA_DEPS}
ARGS --infer_model=${ERNIE_INSTALL_DIR}/model --infer_data=${ERNIE_INSTALL_DIR}/data.txt --refer_result=${ERNIE_INSTALL_DIR}/result.txt --ernie_large=true)
if(NOT WIN32 AND NOT APPLE)
if(NOT WIN32 AND NOT APPLE AND TEST test_analyzer_ernie_large)
set_tests_properties(test_analyzer_ernie_large PROPERTIES TIMEOUT 150 LABELS "RUN_TYPE=NIGHTLY")
endif()
if (WIN32)
if (WIN32 AND TEST test_analyzer_ernie_large)
set_tests_properties(test_analyzer_ernie_large PROPERTIES TIMEOUT 200)
endif()
......@@ -645,6 +645,10 @@ if(WITH_GPU)
ARGS --infer_model=${RESNET50_MODEL_DIR})
endif()
if("$ENV{CI_SKIP_CPP_TEST}" STREQUAL "ON")
return()
endif()
if(WITH_GPU AND TENSORRT_FOUND)
set_tests_properties(trt_resnext_test PROPERTIES TIMEOUT 300)
set_tests_properties(trt_quant_int8_yolov3_r50_test PROPERTIES TIMEOUT 300)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册