From f3ba8d5f237b2d275b44f7b12942966edad36a84 Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Thu, 18 Jun 2020 17:24:16 +0200 Subject: [PATCH] Run tox in venv in case of building images tox depends on virtualenv, when it's installed using pip - it tries to upgrade virtualenv, and then fails. Change-Id: Ic9566778f87f8b81563ed012e651cef50d1baa38 --- tests/pre.yml | 8 ++++++++ tests/run.yml | 2 ++ tools/setup_gate.sh | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/pre.yml b/tests/pre.yml index 71f695933d..6f80a60a15 100644 --- a/tests/pre.yml +++ b/tests/pre.yml @@ -36,6 +36,14 @@ - python-virtualenv - python-wheel + - name: Install virtualenv on Debian systems + package: + name: + - virtualenv + become: true + when: + ansible_os_family == "Debian" + - name: Ensure latest pip is installed become: true pip: diff --git a/tests/run.yml b/tests/run.yml index eb47369577..d0d08815ce 100644 --- a/tests/run.yml +++ b/tests/run.yml @@ -47,6 +47,7 @@ - name: Ensure tox is installed pip: name: tox + virtualenv: "{{ ansible_env.HOME }}/tox-venv" when: need_build_image become: true @@ -191,6 +192,7 @@ TAG: "{{ build_image_tag }}" KOLLA_SRC_DIR: "{{ ansible_env.HOME }}/src/opendev.org/openstack/kolla" ACTION: "{{ scenario }}" + TOX_VENV: "{{ ansible_env.HOME }}/tox-venv" UPPER_CONSTRAINTS: "{{ ansible_env.HOME }}/src/opendev.org/openstack/requirements/upper-constraints.txt" # At this point we have generated all necessary configuration, and are diff --git a/tools/setup_gate.sh b/tools/setup_gate.sh index 5cdd9cd64c..a2e0d99de1 100755 --- a/tools/setup_gate.sh +++ b/tools/setup_gate.sh @@ -150,7 +150,7 @@ function prepare_images { fi sudo docker run -d -p 4000:5000 --restart=always -v /opt/kolla_registry/:/var/lib/registry --name registry registry:2 pushd "${KOLLA_SRC_DIR}" - sudo tox -e "build-${BASE_DISTRO}-${INSTALL_TYPE}" + sudo $TOX_VENV/bin/tox -e "build-${BASE_DISTRO}-${INSTALL_TYPE}" popd }