From 1d51de57d3c45a0b618e4d0199c81de5583a9c74 Mon Sep 17 00:00:00 2001 From: Martin Kopec Date: Thu, 21 Mar 2019 17:09:35 +0000 Subject: [PATCH] Add a job for tempest plugins The job will be useful in cases we want to test if the generated tempest.conf works with certain tempest plugins. The job runs heat-tempest-plugin for now. Story: 2005456 Task: 30510 Change-Id: I2640b07263cdd3a8282170fd764c5f31611125ec --- .zuul.yaml | 33 +++++++++++++++++++ .../python-tempestconf-tempest-devstack.yaml | 16 +++++++++ roles/install-plugins/README.rst | 19 +++++++++++ roles/install-plugins/defaults/main.yaml | 1 + roles/install-plugins/tasks/main.yaml | 16 +++++++++ 5 files changed, 85 insertions(+) create mode 100644 roles/install-plugins/README.rst create mode 100644 roles/install-plugins/defaults/main.yaml create mode 100644 roles/install-plugins/tasks/main.yaml diff --git a/.zuul.yaml b/.zuul.yaml index 91ed6422..1c2070e0 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -15,6 +15,7 @@ - python-tempestconf-tempest-devstack-demo-py3 - python-tempestconf-tempest-packstack-admin - python-tempestconf-tempest-packstack-demo + - python-tempestconf-tempest-devstack-admin-plugins - tripleo-ci-centos-7-scenario002-standalone - tripleo-ci-centos-7-standalone-os-tempest - refstack-client-devstack-tempestconf @@ -26,6 +27,7 @@ - python-tempestconf-tempest-devstack-demo-py3 - python-tempestconf-tempest-packstack-admin - python-tempestconf-tempest-packstack-demo + - python-tempestconf-tempest-devstack-admin-plugins - tripleo-ci-centos-7-scenario002-standalone - tripleo-ci-centos-7-standalone-os-tempest - refstack-client-devstack-tempestconf @@ -35,6 +37,8 @@ parent: devstack description: Base job for python-tempestconf on a devstack environment required-projects: + - openstack/heat + - openstack/heat-tempest-plugin - openstack/manila - openstack/manila-ui - openstack/manila-tempest-plugin @@ -51,11 +55,17 @@ '{{ devstack_base_dir }}/tempest/etc/tempest.conf': logs '{{ zuul.project.src_dir }}/etc/accounts.yaml': logs devstack_plugins: + heat: https://opendev.org/openstack/heat manila: https://opendev.org/openstack/manila manila-ui: https://opendev.org/openstack/manila-ui devstack_localrc: MANILA_USE_UWSGI: False MANILA_USE_MOD_WSGI: False + devstack_services: + h-eng: True + h-api: True + h-api-cfn: True + h-api-cw: True irrelevant-files: - config_tempest/tests/.*$ - ^doc/.*$ @@ -90,6 +100,29 @@ - ^releasenotes/.*$ - ^.*\.rst$ +- job: + name: python-tempestconf-tempest-devstack-admin-plugins + parent: python-tempestconf-devstack-base + description: | + Tempest job for python-tempestconf on a devstack environment as the admin user. + run: playbooks/python-tempestconf-tempest-devstack.yaml + vars: + test_regex: + - 'heat_tempest_plugin' + black_regex: + - 'heat_tempest_plugin.tests.scenario.test_volumes.VolumeBackupRestoreIntegrationTest.test_cinder_volume_create_backup_restore' + - 'heat_tempest_plugin.tests.scenario.test_server_software_config.SoftwareConfigIntegrationTest.test_server_software_config' + - 'heat_tempest_plugin.tests.scenario.test_server_signal.ServerSignalIntegrationTest.test_server_signal_userdata_format_software_config' + - 'heat_tempest_plugin.tests.scenario.test_aodh_alarm.AodhAlarmTest.test_alarm' + - 'heat_tempest_plugin.tests.scenario.test_server_cfn_init.CfnInitIntegrationTest.test_server_cfn_init' + - 'heat_tempest_plugin.tests.scenario.test_base_resources.BasicResourcesTest.test_base_resources_integration' + - 'heat_tempest_plugin.tests.functional.test_os_wait_condition.OSWaitCondition.test_create_stack_with_multi_signal_waitcondition' + user: admin + cloud_user: devstack-admin + plugins_paths: + - "~/{{ zuul.projects['opendev.org/openstack/heat-tempest-plugin'].src_dir }}" + tempest_concurrency: 2 + - job: name: python-tempestconf-tempest-devstack-admin parent: python-tempestconf-devstack-base diff --git a/playbooks/python-tempestconf-tempest-devstack.yaml b/playbooks/python-tempestconf-tempest-devstack.yaml index ab304b16..c66ae698 100644 --- a/playbooks/python-tempestconf-tempest-devstack.yaml +++ b/playbooks/python-tempestconf-tempest-devstack.yaml @@ -42,3 +42,19 @@ - name: Run Tempest Tests include_role: name: run-tempest + when: plugins_paths is not defined + - block: + - name: Install tempest plugins + include_role: + name: install-plugins + - name: Setup Tempest Run Directory + include_role: + name: setup-tempest-run-dir + - name: Run Tempest Tests including plugins + include_role: + name: run-tempest + vars: + tox_envlist: "all" + tempest_test_regex: "{{ test_regex|join('|') }}" + tempest_black_regex: "{{ black_regex|join('|') }}" + when: plugins_paths is defined diff --git a/roles/install-plugins/README.rst b/roles/install-plugins/README.rst new file mode 100644 index 00000000..aaa10451 --- /dev/null +++ b/roles/install-plugins/README.rst @@ -0,0 +1,19 @@ +Install tempest plugins +======================= + +The role installs tempest plugins via tox inside venv-tempest virtual +environment. + +**Role variables** + +.. zuul:rolevar:: plugins_paths + :type: list + + A list of paths to tempest plugins which will be installed together with + Tempest (in the same virtual environment). + +.. zuul:rolevar:: devstack_base_dir + :type: string + :default: /opt/stack + + The devstack base directory. diff --git a/roles/install-plugins/defaults/main.yaml b/roles/install-plugins/defaults/main.yaml new file mode 100644 index 00000000..fea05c81 --- /dev/null +++ b/roles/install-plugins/defaults/main.yaml @@ -0,0 +1 @@ +devstack_base_dir: /opt/stack diff --git a/roles/install-plugins/tasks/main.yaml b/roles/install-plugins/tasks/main.yaml new file mode 100644 index 00000000..638bd865 --- /dev/null +++ b/roles/install-plugins/tasks/main.yaml @@ -0,0 +1,16 @@ +- name: Prepare tempest venv + command: tox -r --notest -efull + args: + chdir: "{{devstack_base_dir}}/tempest" + +- name: Install plugins + command: tox -evenv-tempest -- pip install {{ item }} + with_items: "{{ plugins_paths }}" + args: + chdir: "{{devstack_base_dir}}/tempest" + when: plugins_paths is defined + +- name: List installed tempest plugins + command: tox -evenv-tempest -- tempest list-plugins + args: + chdir: "{{devstack_base_dir}}/tempest"