Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Test Mv] move collective/multinode to test dir #51982

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -430,4 +430,3 @@ if((WITH_ROCM OR WITH_GPU) AND (LINUX))
set_tests_properties(test_orthogonal_strategy PROPERTIES TIMEOUT "120")
endif()
add_subdirectory(fleet)
add_subdirectory(multinode)
49 changes: 48 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,59 @@ set(PYTHON_TESTS_DIR
${PADDLE_BINARY_DIR}/test
CACHE INTERNAL "python tests directory")

function(bash_test_modules TARGET_NAME)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python/paddle/fluid/tests/unittests/CMakeLists.txt 下的bash_test_modules能否进行删除?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python/paddle/fluid/tests/unittests/CMakeLists.txt 下的bash_test_modules能否进行删除?

因为 python/paddle/fluid/tests/unittests/CMakeLists.txt 中后续也用到 bash_test_modules 函数,如下图:
image
在 PR-CI-ROCM-Compile 中也会报错:
image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK,可以留到最后删除python/paddle/fluid/tests目录

if(NOT WITH_TESTING)
return()
endif()

set(options SERIAL)
set(oneValueArgs TIMEOUT START_BASH)
set(multiValueArgs DEPS ENVS LABELS)
cmake_parse_arguments(bash_test_modules "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN})

set(timeout 350)
if(${bash_test_modules_TIMEOUT})
set(timeout ${bash_test_modules_TIMEOUT})
endif()

if(WITH_COVERAGE)
add_test(
NAME ${TARGET_NAME}
COMMAND
${CMAKE_COMMAND} -E env PYTHONPATH=${PADDLE_BINARY_DIR}/python
TEST_TARGET_NAME=${TARGET_NAME} TEST_TIMEOUT=${timeout}
${bash_test_modules_ENVS} WITH_COVERAGE=ON
COVERAGE_FILE=${PADDLE_BINARY_DIR}/python-coverage.data bash
${CMAKE_CURRENT_BINARY_DIR}/${bash_test_modules_START_BASH}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
else()
add_test(
NAME ${TARGET_NAME}
COMMAND
${CMAKE_COMMAND} -E env PYTHONPATH=${PADDLE_BINARY_DIR}/python
TEST_TARGET_NAME=${TARGET_NAME} TEST_TIMEOUT=${timeout}
${bash_test_modules_ENVS} bash
${CMAKE_CURRENT_BINARY_DIR}/${bash_test_modules_START_BASH}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endif()

if(bash_test_modules_SERIAL)
set_property(TEST ${TARGET_NAME} PROPERTY RUN_SERIAL 1)
endif()

if(bash_test_modules_LABELS)
set_tests_properties(${TARGET_NAME} PROPERTIES LABELS
${bash_test_modules_LABELS})
endif()
endfunction()

if(WITH_TESTING)
# add_subdirectory(asp)
# add_subdirectory(auto_parallel)
# add_subdirectory(autograd)
add_subdirectory(book)
# add_subdirectory(collective)
add_subdirectory(collective)
# add_subdirectory(composite_ops)
# add_subdirectory(contrib)
add_subdirectory(cpp)
Expand Down
1 change: 1 addition & 0 deletions test/collective/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(multinode)
File renamed without changes.
File renamed without changes.
File renamed without changes.