Skip to content

Commit

Permalink
Added ctest labels for FE tests only if FW is found (#20483)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov authored Oct 16, 2023
1 parent a5b5623 commit e812831
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 32 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/linux_conditional_compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ jobs:
# For running Paddle frontend unit tests
python3 -m pip install -r ${OPENVINO_REPO}/src/frontends/paddle/tests/requirements.txt
# see https://github.com/PaddlePaddle/Paddle/issues/55597#issuecomment-1718131420
wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb
apt-get install ./libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb
#
# Build
Expand Down
4 changes: 3 additions & 1 deletion cmake/developer_package/add_target_helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ function(ov_add_test_target)
else()
add_test(NAME ${ARG_NAME} COMMAND ${ARG_NAME})
endif()
set_property(TEST ${ARG_NAME} PROPERTY LABELS ${ARG_LABELS})
if(ARG_LABELS)
set_property(TEST ${ARG_NAME} PROPERTY LABELS ${ARG_LABELS})
endif()

install(TARGETS ${ARG_NAME}
RUNTIME DESTINATION tests
Expand Down
42 changes: 23 additions & 19 deletions src/frontends/paddle/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,6 @@

set(TARGET_NAME "paddle_tests")

ov_add_test_target(
NAME ${TARGET_NAME}
ROOT ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDENCIES
paddle_test_models
openvino_paddle_frontend
paddle_fe_standalone_build_test
LINK_LIBRARIES
cnpy
frontend_shared_test_classes
openvino_paddle_frontend
openvino::runtime
gtest_main_manifest
func_test_utils
ADD_CLANG_FORMAT
# LABELS
# OV UNIT PADDLE_FE
)

# Test model generating
set(PADDLE_REQ "${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt")
if(Python3_Interpreter_FOUND)
Expand All @@ -43,6 +24,29 @@ endif()
# PDPD 2.5.1 is not compatible with tests models we use
set(paddlepaddle_FOUND OFF)

if(paddlepaddle_FOUND)
set(ctest_labels OV UNIT)
endif()

ov_add_test_target(
NAME ${TARGET_NAME}
ROOT ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDENCIES
paddle_test_models
openvino_paddle_frontend
paddle_fe_standalone_build_test
LINK_LIBRARIES
cnpy
frontend_shared_test_classes
openvino_paddle_frontend
openvino::runtime
gtest_main_manifest
func_test_utils
ADD_CLANG_FORMAT
LABELS
${ctest_labels} PADDLE_FE
)

set(TEST_PADDLE_MODELS_DIRNAME ${TEST_MODEL_ZOO}/paddle_test_models)
target_compile_definitions(${TARGET_NAME} PRIVATE -D TEST_PADDLE_MODELS_DIRNAME=\"${TEST_PADDLE_MODELS_DIRNAME}/\")

Expand Down
16 changes: 10 additions & 6 deletions src/frontends/tensorflow/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ if (NOT ENABLE_INTEL_CPU)
set(EXCLUDED_TESTS ${CMAKE_CURRENT_SOURCE_DIR}/compilation.cpp)
endif()

ov_check_pip_packages(REQUIREMENTS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt"
MESSAGE_MODE WARNING
WARNING_MESSAGE "TensorFlow testing models weren't generated, some tests will fail due models not found"
RESULT_VAR tensorflow_FOUND)

if(tensorflow_FOUND)
set(ctest_labels OV UNIT)
endif()

ov_add_test_target(
NAME ${TARGET_NAME}
ROOT ${CMAKE_CURRENT_SOURCE_DIR}
Expand All @@ -22,16 +31,11 @@ ov_add_test_target(
openvino_tensorflow_common
ADD_CLANG_FORMAT
LABELS
OV UNIT TF_FE
${ctest_labels} TF_FE
)

# Test model generating

ov_check_pip_packages(REQUIREMENTS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt"
MESSAGE_MODE WARNING
WARNING_MESSAGE "TensorFlow testing models weren't generated, some tests will fail due models not found"
RESULT_VAR tensorflow_FOUND)

set(TEST_TENSORFLOW_MODELS_DIRNAME ${TEST_MODEL_ZOO}/tensorflow_test_models)
target_compile_definitions(${TARGET_NAME} PRIVATE -D TEST_TENSORFLOW_MODELS_DIRNAME=\"${TEST_TENSORFLOW_MODELS_DIRNAME}/\")

Expand Down
16 changes: 10 additions & 6 deletions src/frontends/tensorflow_lite/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@

set(TARGET_NAME "ov_tensorflow_lite_frontend_tests")

ov_check_pip_packages(REQUIREMENTS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt"
MESSAGE_MODE WARNING
WARNING_MESSAGE "TensorFlow Lite testing models weren't generated, some tests will fail due models not found"
RESULT_VAR tensorflow_FOUND)

if(tensorflow_FOUND)
set(ctest_labels OV UNIT)
endif()

ov_add_test_target(
NAME ${TARGET_NAME}
ROOT ${CMAKE_CURRENT_SOURCE_DIR}
Expand All @@ -16,16 +25,11 @@ ov_add_test_target(
openvino_tensorflow_lite_frontend
ADD_CLANG_FORMAT
LABELS
OV UNIT TFL_FE
${ctest_labels} TFL_FE
)

# Test model generating

ov_check_pip_packages(REQUIREMENTS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt"
MESSAGE_MODE WARNING
WARNING_MESSAGE "TensorFlow Lite testing models weren't generated, some tests will fail due models not found"
RESULT_VAR tensorflow_FOUND)

set(TEST_TENSORFLOW_LITE_MODELS_DIRNAME ${TEST_MODEL_ZOO}/tensorflow_lite_test_models)
target_compile_definitions(${TARGET_NAME} PRIVATE -D TEST_TENSORFLOW_LITE_MODELS_DIRNAME=\"${TEST_TENSORFLOW_LITE_MODELS_DIRNAME}/\")

Expand Down

0 comments on commit e812831

Please sign in to comment.