From: Willem Jan Withagen Date: Tue, 20 Aug 2019 11:08:50 +0000 (+0200) Subject: test/venv: Fix the python version of the test environment X-Git-Tag: v15.1.0~1573^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c70e7af4a6680307200c5f85727f8f85a3c1533b;p=ceph.git 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 --- 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