diff --git a/.build/docker/run-tests.sh b/.build/docker/run-tests.sh index 50c1d3bf9e..2357a77872 100755 --- a/.build/docker/run-tests.sh +++ b/.build/docker/run-tests.sh @@ -300,6 +300,7 @@ echo "Running container ${container_name} ${docker_id} using image ${image_name} docker exec --user root ${container_name} bash -c "\${CASSANDRA_DIR}/.build/docker/_create_user.sh cassandra $(id -u) $(id -g)" | tee -a ${logfile} docker exec --user root ${container_name} update-alternatives --set python /usr/bin/python${python_version} | tee -a ${logfile} +docker exec --user root ${container_name} update-alternatives --set python3 /usr/bin/python${python_version} | tee -a ${logfile} if [ -n "${DTEST_TMPDIR_LOCAL}" ] && [[ "${target}" =~ ^dtest-upgrade ]] ; then # prepopulate a tmp ccm repository directory, if running dtest-upgrade tests diff --git a/.build/docker/ubuntu-test.docker b/.build/docker/ubuntu-test.docker index 2c52ec94e3..47b26307f0 100644 --- a/.build/docker/ubuntu-test.docker +++ b/.build/docker/ubuntu-test.docker @@ -60,10 +60,15 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ RUN update-alternatives --remove java /usr/lib/jvm/java-8-openjdk-$(dpkg --print-architecture)/jre/bin/java RUN update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-8-openjdk-$(dpkg --print-architecture)/bin/java 1081 RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1 -RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 2 -RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.11 3 -RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.12 4 -RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.13 5 +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1 +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.12 1 +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.13 1 +RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1 +RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 +RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 +RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1 +RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.13 1 RUN python3.8 -m pip install --upgrade pip # generate locales for the standard en_US.UTF8 value we use for testing diff --git a/.build/run-tests.sh b/.build/run-tests.sh index a8d8d9e471..c32fdffa1e 100755 --- a/.build/run-tests.sh +++ b/.build/run-tests.sh @@ -24,8 +24,6 @@ set -o errexit set -o pipefail -[ $DEBUG ] && set -x - # variables, with defaults [ "x${CASSANDRA_DIR}" != "x" ] || CASSANDRA_DIR="$(readlink -f $(dirname -- "$0")/..)" [ "x${DIST_DIR}" != "x" ] || DIST_DIR="${CASSANDRA_DIR}/build" diff --git a/pylib/cassandra-cqlsh-tests.sh b/pylib/cassandra-cqlsh-tests.sh index 7c0caf69a1..511e5d9743 100755 --- a/pylib/cassandra-cqlsh-tests.sh +++ b/pylib/cassandra-cqlsh-tests.sh @@ -23,6 +23,8 @@ # ################################ +[ $DEBUG ] && set -x + WORKSPACE=$1 [ "x${WORKSPACE}" != "x" ] || WORKSPACE="$(readlink -f $(dirname "$0")/..)" @@ -63,6 +65,10 @@ rm -fr ${DIST_DIR}/venv ${DIST_DIR}/test/{html,output,logs} virtualenv-clone ${BUILD_HOME}/env${python_version} ${BUILD_DIR}/venv || virtualenv --python=python3 ${BUILD_DIR}/venv source ${BUILD_DIR}/venv/bin/activate +# Force pip's legacy pkg_resources metadata backend (instead of the importlib.metadata +# backend that pip defaults to on Python 3.11+). see ubuntu-test.docker +export _PIP_USE_IMPORTLIB_METADATA=0 + pip install --exists-action w -r ${CASSANDRA_DIR}/pylib/requirements.txt pip freeze