]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/venv: Fix the python version of the test environment 29761/head
authorWillem Jan Withagen <wjw@digiware.nl>
Tue, 20 Aug 2019 11:08:50 +0000 (13:08 +0200)
committerWillem Jan Withagen <wjw@digiware.nl>
Tue, 27 Aug 2019 13:10:21 +0000 (15:10 +0200)
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 <wjw@digiware.nl>
cmake/modules/AddCephTest.cmake

index b21ae660166ce76dde9c6655d290ff4b663453df..ace6053b1fdb4e7b6eeb6405be2b936aa6f43453 100644 (file)
@@ -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