From e7e15eb1643fbadcf4b04ac870eb2da8f30c18bc Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Thu, 8 Aug 2019 17:32:20 +0300 Subject: [PATCH] Add mixed setup for debian based OS Since debian/ubuntu do not provide packages for tempest plugins, we are using mixed setup. We install tempest as a distro package, while installing tempest plugins from source, but without venv (for system python). That guarantees that we have all required plugins and do tests. To accomplish that variable tempest_plugin_install_source was introduced. Change-Id: I198190d601cf8a922c3afaa69a3c0e42ab075735 --- tasks/main.yml | 3 +++ tasks/tempest_install.yml | 4 ++-- tasks/tempest_install_source.yml | 12 ++++++++---- vars/main.yml | 8 ++++++++ 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index c6ff51c3..da5216b2 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -49,6 +49,9 @@ tags: - tempest-config +- name: Flush handlers + meta: flush_handlers + - import_tasks: tempest_run.yml when: tempest_run | bool tags: diff --git a/tasks/tempest_install.yml b/tasks/tempest_install.yml index 37710355..b9003546 100644 --- a/tasks/tempest_install.yml +++ b/tasks/tempest_install.yml @@ -27,11 +27,11 @@ # NOTE(noonedeadpunk): -# Applying default filter for tempest_install_method is required despite the variable being defined +# Applying default filter is required despite the variable being defined # in defaults as in case of non-integrated tests meta handlers from other roles might fail. - name: Install Tempest packages from PIP import_tasks: tempest_install_source.yml - when: (tempest_install_method | default('source')) == 'source' + when: (tempest_install_method | default('source')) == 'source' or (tempest_plugin_install_source | default(False)) - name: Install stackviz on venv import_role: diff --git a/tasks/tempest_install_source.yml b/tasks/tempest_install_source.yml index ac234d9e..0b542ae5 100644 --- a/tasks/tempest_install_source.yml +++ b/tasks/tempest_install_source.yml @@ -13,6 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Note(noonedeadpunk) When tempest_plugin_install_source is true, we do not +# want pip packages to be installed inside venv, since tempest itself is +# installed via system packages so that plugins will be visable for tempest. - name: Install the python venv import_role: name: "python_venv_build" @@ -25,6 +28,7 @@ - section: "tempest" option: "venv_tag" value: "{{ tempest_venv_tag }}" + when: not tempest_plugin_install_source - name: Get tempest plugins from git git: @@ -43,8 +47,8 @@ pip: name: "/opt/{{ item.name|replace('-', '_') }}_{{ item.branch|replace('/', '_') }}" state: "{{ tempest_pip_package_state }}" - virtualenv: "{{ tempest_venv_bin | dirname }}" - virtualenv_site_packages: "no" + virtualenv: "{{ tempest_plugin_install_source | ternary(omit, tempest_venv_bin | dirname) }}" + virtualenv_site_packages: "{{ tempest_plugin_install_source | ternary(omit, 'no') }}" extra_args: >- {{ tempest_pip_install_args }} --isolated @@ -59,8 +63,8 @@ pip: name: "{{ item.package }}" state: "{{ tempest_pip_package_state }}" - virtualenv: "{{ tempest_venv_bin | dirname }}" - virtualenv_site_packages: "no" + virtualenv: "{{ tempest_mixed_setup | ternary(omit, tempest_venv_bin | dirname) }}" + virtualenv_site_packages: "{{ tempest_mixed_setup | ternary(omit, 'no') }}" extra_args: >- {{ tempest_pip_install_args }} --isolated diff --git a/vars/main.yml b/vars/main.yml index 3c8cac65..213ea111 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -151,3 +151,11 @@ _tempest_plugins: repo: https://opendev.org/openstack/zaqar-tempest-plugin branch: master install: "{{ tempest_service_available_zaqar | bool }}" + +# Note(noonedeadpunk): +# Ubuntu does not publish tempest plugin packages. They do +# all their testing using the source-based installation of +# tempest. +# For mixed setup we are using source install tasks, except +# that we're deploying pip packages without venv. +tempest_plugin_install_source: "{{ ((tempest_install_method == 'distro') and (ansible_os_family | lower == 'debian')) | bool }}"