Skip to content

Commit 3658fc2

Browse files
committed
MB-67886: Fix cluster_tests job
The job was depending on the shipped python having ensurepip, which is being removed as it does not need to be shipped with couchbase. Instead we now use a separate python virtual env, which already has pip installed. Change-Id: I4f5009d50e7508b172a12b6a0463acf79be720df Reviewed-on: https://review.couchbase.org/c/ns_server/+/231838 Well-Formed: Restriction Checker Reviewed-by: Ben Huddleston <[email protected]> Tested-by: Peter Searby <[email protected]>
1 parent 22e5bee commit 3658fc2

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

cluster_tests/CMakeLists.txt

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
1+
2+
# Fetch WORKSPACE from ENV for Jenkins
3+
SET(WORKSPACE ${CMAKE_CURRENT_BINARY_DIR})
4+
IF ($ENV{WORKSPACE})
5+
SET(WORKSPACE $ENV{WORKSPACE})
6+
ENDIF ($ENV{WORKSPACE})
7+
# Fetch WORKSPACE from ENV for Jenkins
8+
SET(VIRTUALENV_NAME ns_server_cluster_tests})
9+
IF ($ENV{VIRTUALENV_NAME})
10+
SET(VIRTUALENV_NAME $ENV{VIRTUALENV_NAME})
11+
ENDIF ($ENV{VIRTUALENV_NAME})
12+
113
ADD_CUSTOM_TARGET(cluster_tests_python_requirements
2-
COMMAND ${PYTHON_EXE} -m ensurepip
3-
COMMAND ${PYTHON_EXE} -m pip
14+
COMMAND python -m venv ${WORKSPACE}/${VIRTUALENV_NAME}
15+
COMMAND source ${WORKSPACE}/${VIRTUALENV_NAME}/bin/activate
16+
COMMAND python -m pip install --upgrade pip
17+
COMMAND python -m pip
418
install -r ${CMAKE_CURRENT_SOURCE_DIR}/requirements.txt)
519
SEPARATE_ARGUMENTS(cluster_test_args NATIVE_COMMAND $ENV{CLUSTER_TESTS_ARGS})
620
ADD_CUSTOM_TARGET(cluster_tests
7-
COMMAND JAVA_HOME=${Java_JAVA_HOME} ${PYTHON_EXE}
21+
COMMAND source ${WORKSPACE}/${VIRTUALENV_NAME}/bin/activate
22+
COMMAND JAVA_HOME=${Java_JAVA_HOME} python
823
${CMAKE_CURRENT_SOURCE_DIR}/run.py ${cluster_test_args}
924
DEPENDS cluster_tests_python_requirements
1025
COMMAND_EXPAND_LISTS)

0 commit comments

Comments
 (0)