From bd66017874e995de8251b5bcc367913e622fe95f Mon Sep 17 00:00:00 2001 From: Luigi Toscano Date: Thu, 21 Feb 2019 00:47:34 +0100 Subject: [PATCH] Native Zuul v3 dashboard-integration test - create a native Zuul v3 job, and move it to experimental until it works; - install libav-utils on dpkg systems and enable the capture of the video; - adapt to the changes in OverviewPage: * go_to_system_flavorspage -> go_to_admin_compute_flavorspage * go_to_compute_imagespage -> go_to_project_compute_imagespage The job is failing right now, but apart the increased running time, at least the tests are now executed. Story: 2001686 Task: 8662 Change-Id: I311203779bd3e6c6660cfe1b84e89c7dc0825c98 --- .zuul.yaml | 36 +++++++++++++++++-- bindep.txt | 9 +++++ .../sahara-dashboard-integration/pre.yaml | 8 +++++ .../sahara-dashboard-integration/run.yaml | 13 +++++++ .../defaults/main.yaml | 4 +++ .../files/fake_config.json | 7 ++++ .../tasks/main.yaml | 10 ++++++ .../defaults/main.yaml | 5 +++ .../files/legacy_panels.conf | 5 +++ .../tasks/main.yaml | 21 +++++++++++ .../test/integration_tests/tests/test_crud.py | 8 ++--- .../tests/test_sahara_image_registry.py | 4 +-- tox.ini | 1 + 13 files changed, 123 insertions(+), 8 deletions(-) create mode 100644 playbooks/sahara-dashboard-integration/pre.yaml create mode 100644 playbooks/sahara-dashboard-integration/run.yaml create mode 100644 roles/post-devstack-sahara-ui-integration/defaults/main.yaml create mode 100644 roles/post-devstack-sahara-ui-integration/files/fake_config.json create mode 100644 roles/post-devstack-sahara-ui-integration/tasks/main.yaml create mode 100644 roles/setup-sahara-ui-integration/defaults/main.yaml create mode 100644 roles/setup-sahara-ui-integration/files/legacy_panels.conf create mode 100644 roles/setup-sahara-ui-integration/tasks/main.yaml diff --git a/.zuul.yaml b/.zuul.yaml index b0a3be52..298b1526 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -9,8 +9,9 @@ jobs: - sahara-dashboard-tox-py35dj20: voting: false - - legacy-sahara-dashboard-dsvm-integration: - voting: false + experimental: + jobs: + - sahara-dashboard-integration - job: name: sahara-dashboard-tox-base @@ -28,3 +29,34 @@ parent: sahara-dashboard-tox-base vars: tox_envlist: py35dj20 + +- job: + name: sahara-dashboard-integration + parent: devstack + required-projects: + - openstack/heat + - openstack/horizon + - openstack/sahara + - openstack/sahara-plugin-ambari + - openstack/sahara-plugin-cdh + - openstack/sahara-plugin-mapr + - openstack/sahara-plugin-spark + - openstack/sahara-plugin-storm + - openstack/sahara-plugin-vanilla + - openstack/sahara-dashboard + roles: + - zuul: openstack/horizon + vars: + devstack_plugins: + sahara: 'git://git.openstack.org/openstack/sahara' + sahara-dashboard: 'git://git.openstack.org/openstack/sahara-dashboard' + heat: 'git://git.openstack.org/openstack/heat' + devstack_services: + horizon: true + tls-proxy: false + pre-run: playbooks/sahara-dashboard-integration/pre.yaml + run: playbooks/sahara-dashboard-integration/run.yaml + irrelevant-files: + - ^.*\.rst$ + - ^doc/.*$ + - ^releasenotes/.*$ diff --git a/bindep.txt b/bindep.txt index 4b3f54e2..24697297 100644 --- a/bindep.txt +++ b/bindep.txt @@ -34,3 +34,12 @@ python3.5 [platform:ubuntu-xenial] uuid-dev [platform:dpkg] zlib-devel [platform:rpm] zlib1g-dev [platform:dpkg] + +# integration tests +firefox [integrationtests] +dbus [integrationtests platform:redhat] +dbus-1 [integrationtests platform:suse] +xvfb [integrationtests platform:dpkg] +# already part of xorg-x11-server on openSUSE +xorg-x11-server-Xvfb [integrationtests platform:redhat] +libav-tools [integrationtests platform:dpkg] diff --git a/playbooks/sahara-dashboard-integration/pre.yaml b/playbooks/sahara-dashboard-integration/pre.yaml new file mode 100644 index 00000000..dc3c599c --- /dev/null +++ b/playbooks/sahara-dashboard-integration/pre.yaml @@ -0,0 +1,8 @@ +--- +- hosts: controller + roles: + - role: bindep + bindep_profile: integrationtests + become: true + - setup-selenium-tests + - setup-sahara-ui-integration diff --git a/playbooks/sahara-dashboard-integration/run.yaml b/playbooks/sahara-dashboard-integration/run.yaml new file mode 100644 index 00000000..0de99e3b --- /dev/null +++ b/playbooks/sahara-dashboard-integration/run.yaml @@ -0,0 +1,13 @@ +--- +- hosts: all + strategy: linear + roles: + - orchestrate-devstack + +- hosts: controller + roles: + - post-devstack-sahara-ui-integration + - role: tox + tox_environment: + AVCONV_INSTALLED: 1 + tox_envlist: py27integration diff --git a/roles/post-devstack-sahara-ui-integration/defaults/main.yaml b/roles/post-devstack-sahara-ui-integration/defaults/main.yaml new file mode 100644 index 00000000..ef8b3c1d --- /dev/null +++ b/roles/post-devstack-sahara-ui-integration/defaults/main.yaml @@ -0,0 +1,4 @@ +--- +devstack_base_dir: "/opt/stack" +sahara_cloud_admin: "devstack-admin" +sahara_cloud_demo: "devstack" diff --git a/roles/post-devstack-sahara-ui-integration/files/fake_config.json b/roles/post-devstack-sahara-ui-integration/files/fake_config.json new file mode 100644 index 00000000..d17b69f2 --- /dev/null +++ b/roles/post-devstack-sahara-ui-integration/files/fake_config.json @@ -0,0 +1,7 @@ +{ + "plugin_labels": { + "hidden": { + "status": false + } + } +} diff --git a/roles/post-devstack-sahara-ui-integration/tasks/main.yaml b/roles/post-devstack-sahara-ui-integration/tasks/main.yaml new file mode 100644 index 00000000..83c542d3 --- /dev/null +++ b/roles/post-devstack-sahara-ui-integration/tasks/main.yaml @@ -0,0 +1,10 @@ +--- +- name: copy the updated config snipped which enables the fake plugin + copy: + src: fake_config.json + dest: /tmp/sahara_fake_config.json + +- name: change the config of the fake plugin + shell: | + openstack --os-cloud {{ sahara_cloud_admin }} --os-project-name demo \ + dataprocessing plugin update fake /tmp/sahara_fake_config.json diff --git a/roles/setup-sahara-ui-integration/defaults/main.yaml b/roles/setup-sahara-ui-integration/defaults/main.yaml new file mode 100644 index 00000000..5419ffef --- /dev/null +++ b/roles/setup-sahara-ui-integration/defaults/main.yaml @@ -0,0 +1,5 @@ +--- +devstack_base_dir: "/opt/stack" +sahara_cloud_image: "https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img" +# TODO: if the following option is changed, it should also be specified in tempest.conf +sahara_cloud_image_remote_path: "/tmp/xenial-server-cloudimg-amd64-disk1.img" diff --git a/roles/setup-sahara-ui-integration/files/legacy_panels.conf b/roles/setup-sahara-ui-integration/files/legacy_panels.conf new file mode 100644 index 00000000..285cf3e8 --- /dev/null +++ b/roles/setup-sahara-ui-integration/files/legacy_panels.conf @@ -0,0 +1,5 @@ +[image] +panel_type=legacy + +[flavors] +panel_type=legacy diff --git a/roles/setup-sahara-ui-integration/tasks/main.yaml b/roles/setup-sahara-ui-integration/tasks/main.yaml new file mode 100644 index 00000000..0a93cb98 --- /dev/null +++ b/roles/setup-sahara-ui-integration/tasks/main.yaml @@ -0,0 +1,21 @@ +--- +- name: download the ubuntu image file + get_url: + url: "{{ sahara_cloud_image }}" + dest: "{{ sahara_cloud_image_remote_path }}" + +# enable legacy panels (two files in local/local_settings.d and a new setting file +# for the integration tests) +- name: setup the old behavior of tables for testing purposes + copy: + src: "{{ devstack_base_dir }}/horizon/openstack_dashboard/local/local_settings.d/{{ item }}.example" + dest: "{{ devstack_base_dir }}/horizon/openstack_dashboard/local/local_settings.d/{{ item }}" + remote_src: yes + with_items: + - '_20_integration_tests_scaffolds.py' + - '_2010_integration_tests_deprecated.py' + +- name: setup the old behavior of panels for testing purposes + copy: + src: legacy_panels.conf + dest: "{{ devstack_base_dir }}/horizon/openstack_dashboard/test/integration_tests/local-horizon.conf" diff --git a/sahara_dashboard/test/integration_tests/tests/test_crud.py b/sahara_dashboard/test/integration_tests/tests/test_crud.py index 243befdb..0f96dca0 100644 --- a/sahara_dashboard/test/integration_tests/tests/test_crud.py +++ b/sahara_dashboard/test/integration_tests/tests/test_crud.py @@ -35,7 +35,7 @@ class TestCRUDBase(SaharaTestCase): self.jobtemplate_name = self.gen_name('test-job') def create_flavor(self): - flavors_page = self.home_pg.go_to_system_flavorspage() + flavors_page = self.home_pg.go_to_admin_compute_flavorspage() flavors_page.create_flavor( name=self.flavor_name, @@ -47,12 +47,12 @@ class TestCRUDBase(SaharaTestCase): self.assertTrue(flavors_page.is_flavor_present(self.flavor_name)) def delete_flavor(self): - flavors_page = self.home_pg.go_to_system_flavorspage() + flavors_page = self.home_pg.go_to_admin_compute_flavorspage() flavors_page.delete_flavor_by_row(self.flavor_name) self.assertFalse(flavors_page.is_flavor_present(self.flavor_name)) def create_image(self): - image_pg = self.home_pg.go_to_compute_imagespage() + image_pg = self.home_pg.go_to_project_compute_imagespage() image_pg.create_image( self.image_name, image_file=self.CONFIG.sahara.fake_image_location) image_pg._wait_until( @@ -60,7 +60,7 @@ class TestCRUDBase(SaharaTestCase): timeout=10 * 60) def delete_image(self): - image_pg = self.home_pg.go_to_compute_imagespage() + image_pg = self.home_pg.go_to_project_compute_imagespage() image_pg.delete_image(self.image_name) def register_image(self): diff --git a/sahara_dashboard/test/integration_tests/tests/test_sahara_image_registry.py b/sahara_dashboard/test/integration_tests/tests/test_sahara_image_registry.py index 928e66e8..3d9f15e0 100644 --- a/sahara_dashboard/test/integration_tests/tests/test_sahara_image_registry.py +++ b/sahara_dashboard/test/integration_tests/tests/test_sahara_image_registry.py @@ -22,7 +22,7 @@ class TestSaharaImageRegistry(SaharaTestCase): def setUp(self): super(TestSaharaImageRegistry, self).setUp() - image_pg = self.home_pg.go_to_compute_imagespage() + image_pg = self.home_pg.go_to_project_compute_imagespage() image_pg.create_image( IMAGE_NAME, image_file=self.CONFIG.sahara.fake_image_location) image_pg.find_message_and_dismiss(messages.SUCCESS) @@ -52,6 +52,6 @@ class TestSaharaImageRegistry(SaharaTestCase): "Image was not unregistered.") def tearDown(self): - image_pg = self.home_pg.go_to_compute_imagespage() + image_pg = self.home_pg.go_to_project_compute_imagespage() image_pg.delete_image(IMAGE_NAME) super(TestSaharaImageRegistry, self).tearDown() diff --git a/tox.ini b/tox.ini index c72b2009..b547e443 100644 --- a/tox.ini +++ b/tox.ini @@ -44,6 +44,7 @@ commands = pip install django>=2.0,<2.1 [testenv:py27integration] basepython = python2.7 +passenv = AVCONV_INSTALLED setenv = INTEGRATION_TESTS=1 SELENIUM_HEADLESS=1