Files
openstack-ansible-os_tempest/tasks/tempest_install_source.yml
Jonathan Rosser 0317e9fc02 Refactor tempest plugin install from source
Previously the tempest plugins were installed using pip independant
of the python_venv_build role, in the past OSA could support a mixed install
of a distro tempest package and source code plugins. The mixed mode has been
removed but the tempest & tempest plugins installation tasks remain seperate.

Tempest is installed using python_venv_build, and the plugins are installed
directly using the ansible pip module. Unfortunatly, these two approaches do
not handle openstack upper-constraints in the same way, particularly for a
package that is installed from source code.

The python_venv_build role will correctly install a version of tempest
corresponding to the specified git SHA even when u-c specifies an earlier version
of the package. Unfortunately, when installing the tempest plugins with
the pip module, the previously installed tempest packages gets downgraded to
match the version specified in u-c as the pip module is unaware of the combined
source + u-c constraints generated by python_venv_build.

Tempest is an unusual case, because it is perhaps the only "top level" openstack
projects which has its own constraint appear in u-c.

This patch also corrects the use use of the venv_wheel_build_enable variable.
As a role default the value of this variable is changed in the whole scope of
the role becasue it is overridden during the stackviz install. The approach
used should be reviewed and refined in a future patch.

This patch also marks bionic/distro jobs as non voting as there has not been
a release of tempest which passes keystone test_list_user_groups test.

Change-Id: I5e8c8540b30865aaccafe59c73fae6fdd6da80a8
2020-04-22 00:24:29 +01:00

43 lines
1.8 KiB
YAML

---
# Copyright 2014, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Generate list of tempest plugins installed from source code
set_fact:
tempest_pip_plugins: "{{ tempest_pip_plugins | default([]) + [item.name] }}"
tempest_plugin_constraints: "{{ tempest_plugin_constraints | default([]) + ['git+' ~ item.repo ~ '@' ~ item.branch ~ '#egg=' ~ item.name] }}"
with_items: "{{ tempest_plugins }}"
when: item.repo is defined
- name: Append to list any tempest plugins installed from python packages
set_fact:
tempest_pip_plugins: "{{ tempest_pip_plugins | default([]) + [item.package] }}"
with_items: "{{ tempest_plugins }}"
when: item.package is defined
- name: Install the python venv
import_role:
name: "python_venv_build"
vars:
venv_python_executable: "{{ tempest_venv_python_executable }}"
venv_build_constraints: "{{ tempest_plugin_constraints + tempest_git_constraints }}"
venv_install_destination_path: "{{ tempest_venv_bin | dirname }}"
venv_pip_install_args: "{{ tempest_pip_install_args }}"
venv_wheel_build_enable: "{{ venv_build_host != inventory_hostname }}"
venv_pip_packages: "{{ tempest_pip_packages + tempest_pip_plugins }}"
venv_facts_when_changed:
- section: "tempest"
option: "venv_tag"
value: "{{ tempest_venv_tag }}"