function(add_tox_test name tox_path)
set(test_name run-tox-${name})
+ set(venv_path ${CEPH_BUILD_VIRTUALENV}/${name}-virtualenv)
+ add_custom_command(
+ OUTPUT ${venv_path}/bin/activate
+ COMMAND ${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh ${venv_path}
+ WORKING_DIRECTORY ${tox_path}
+ COMMENT "preparing venv for ${name}")
+ add_custom_target(${name}-venv
+ DEPENDS ${venv_path}/bin/activate)
+ add_dependencies(tests ${name}-venv)
add_test(
NAME ${test_name}
COMMAND ${CMAKE_SOURCE_DIR}/src/script/run_tox.sh
--with-python2 ${WITH_PYTHON2}
--with-python3 ${WITH_PYTHON3}
--tox-path ${tox_path}
- --venv-path ${CEPH_BUILD_VIRTUALENV}/${name})
+ --venv-path ${venv_path})
set_property(
TEST ${test_name}
PROPERTY ENVIRONMENT
add_subdirectory(dashboard)
-add_subdirectory(insights)
-add_subdirectory(ansible)
-add_subdirectory(orchestrator_cli)
# Location needs to match default setting for mgr_module_path, currently:
# OPTION(mgr_module_path, OPT_STR, CEPH_PKGLIBDIR "/mgr")
+++ /dev/null
-set(MGR_ANSIBLE_VIRTUALENV ${CEPH_BUILD_VIRTUALENV}/mgr-ansible-virtualenv)
-
-add_custom_target(mgr-ansible-test-venv
- COMMAND ${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh --python=${MGR_PYTHON_EXECUTABLE} ${MGR_ANSIBLE_VIRTUALENV}
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/pybind/mgr/ansible
- COMMENT "ansible tests virtualenv is being created")
-add_dependencies(tests mgr-ansible-test-venv)
+++ /dev/null
-set(MGR_INSIGHTS_VIRTUALENV ${CEPH_BUILD_VIRTUALENV}/mgr-insights-virtualenv)
-
-add_custom_target(mgr-insights-test-venv
- COMMAND ${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh --python=${MGR_PYTHON_EXECUTABLE} ${MGR_INSIGHTS_VIRTUALENV}
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/pybind/mgr/insights
- COMMENT "insights tests virtualenv is being created")
-add_dependencies(tests mgr-insights-test-venv)
+++ /dev/null
-set(MGR_ORCHESTRATOR_CLI_VIRTUALENV ${CEPH_BUILD_VIRTUALENV}/mgr-orchestrator_cli-virtualenv)
-
-add_custom_target(mgr-orchestrator_cli-test-venv
- COMMAND ${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh --python=${MGR_PYTHON_EXECUTABLE} ${MGR_ORCHESTRATOR_CLI_VIRTUALENV}
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/pybind/mgr/orchestrator_cli
- COMMENT "orchestrator_cli tests virtualenv is being created")
-add_dependencies(tests mgr-orchestrator_cli-test-venv)