From c70e7af4a6680307200c5f85727f8f85a3c1533b Mon Sep 17 00:00:00 2001 From: Willem Jan Withagen Date: Tue, 20 Aug 2019 13:08:50 +0200 Subject: [PATCH] test/venv: Fix the python version of the test environment Otherwise it will result in: [ 59%] preparing venv for mgr-dashboard New python executable in /home/jenkins/workspace/ceph-master/build/mgr-dashboard-virtualenv/bin/python2.7 Also creating executable in /home/jenkins/workspace/ceph-master/build/mgr-dashboard-virtualenv/bin/python Installing setuptools, pip, wheel...done. Running virtualenv with interpreter /usr/local/bin/python2.7 Even though the Cmake options contained: '-DWITH_PYTHON2=OFF' '-DWITH_PYTHON3=3' '-DMGR_PYTHON_VERSION=3' Mostly due to the fact that src/tools/setup-virtualenv.sh default to: PYTHON_BINARY="python2.7" Signed-off-by: Willem Jan Withagen --- cmake/modules/AddCephTest.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/modules/AddCephTest.cmake b/cmake/modules/AddCephTest.cmake index b21ae660166c..ace6053b1fdb 100644 --- a/cmake/modules/AddCephTest.cmake +++ b/cmake/modules/AddCephTest.cmake @@ -72,9 +72,10 @@ function(add_tox_test name) list(APPEND tox_envs ${TOXTEST_TOX_ENVS}) endif() string(REPLACE ";" "," tox_envs "${tox_envs}") + find_package(Python REQUIRED) add_custom_command( OUTPUT ${venv_path}/bin/activate - COMMAND ${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh ${venv_path} + COMMAND ${CMAKE_SOURCE_DIR}/src/tools/setup-virtualenv.sh --python="${Python_EXECUTABLE}" ${venv_path} WORKING_DIRECTORY ${tox_path} COMMENT "preparing venv for ${name}") add_custom_target(${name}-venv -- 2.47.3