Browse Source

Added support for installing tempest plugins from git

In order to use it, in any FS, set tempest_format to venv
and then set:
tempest_plugins_venv:
  - '<complete upstream openstack tempest plugin git url>'

Change-Id: I95a4449ca3976a914faf1ba5f3f4c0e756a6fefc
Chandan Kumar 6 months ago
parent
commit
881d16fb42

+ 9
- 0
roles/validate-tempest/README.md View File

@@ -35,6 +35,15 @@ Role Variables
35 35
 * `check_tempest_bugs`: true/false - Will check every bugzilla and launchpad bug in the yaml skip file
36 36
 * `tempest_plugins`: list - List of openstack services tempest plugins to be
37 37
                      installed
38
+* `tempest_plugins_git`: list - (optional) List of URLs for openstack tempest plugins you want to have installed.
39
+                                (Required) `tempest_format`: venv
40
+                                For example:
41
+                                ```
42
+                                tempest_format: venv
43
+                                tempest_plugins_git: [https://git.openstack.org/openstack/tempest-tripleo-ui,
44
+                                                      https://git.openstack.org/openstack/keystone-tempest-plugin,
45
+                                                      https://git.openstack.org/openstack/cinder-tempest-plugin]
46
+                                ```
38 47
 * `tempest_extra_config`: dict - A dict of tempest configuration which needs to be overridden in tempest.conf,
39 48
                           It should be like section.key: value.
40 49
 * `tempest_conf_removal`: dict - A dict of tempest configuration which will be

+ 1
- 1
roles/validate-tempest/defaults/main.yml View File

@@ -58,7 +58,7 @@ tempest_plugins: >-
58 58
   {%- else -%}
59 59
   [ "python-keystone-tests", "python-neutron-tests" ]
60 60
   {%- endif -%}
61
-
61
+tempest_plugins_git: []
62 62
 tempest_extra_config: {}  # A dict containing values which needs to be overridden in tempest.conf
63 63
 skip_file_src: "skip_file.j2"
64 64
 skip_file: skip_file

+ 9
- 0
roles/validate-tempest/tasks/tempest-venv.yml View File

@@ -37,6 +37,15 @@
37 37
         python-virtualenv
38 38
         {% endif %}
39 39
 
40
+- name: Clone tempest plugins
41
+  git:
42
+    repo: "{{ item }}"
43
+    dest: "{{ working_dir }}/{{ item.split('/')[-1] }}"
44
+    version: master
45
+  with_items: "{{ tempest_plugins_git }}"
46
+  when:
47
+    - tempest_format == 'venv'
48
+
40 49
 - name: Install packages required for create venv
41 50
   package:
42 51
     state: present

+ 4
- 0
roles/validate-tempest/templates/configure-tempest.sh.j2 View File

@@ -56,6 +56,10 @@ virtualenv --system-site-packages {{ working_dir }}/tempest_git/.venv
56 56
 {{ working_dir }}/tempest_git/tools/with_venv.sh pip install -U pip
57 57
 {{ working_dir }}/tempest_git/tools/with_venv.sh pip install -U setuptools
58 58
 {{ working_dir }}/tempest_git/tools/with_venv.sh pip install {{ working_dir }}/tempest_git junitxml
59
+# Install tempest plugins in tempest .venv
60
+{% for tempest_plugin in (tempest_plugins_git|default([])) %}
61
+{{ working_dir }}/tempest_git/tools/with_venv.sh pip install {{ working_dir }}/{{ tempest_plugin.replace('.git', '').split('/')[-1] }}
62
+{% endfor %}
59 63
 
60 64
 # Install python-tempestconf
61 65
 {% if release != 'newton'%}

Loading…
Cancel
Save