diff --git a/.zuul.yaml b/.zuul.yaml index b0a3be52..bb8aea9c 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -9,7 +9,7 @@ jobs: - sahara-dashboard-tox-py35dj20: voting: false - - legacy-sahara-dashboard-dsvm-integration: + - sahara-dashboard-integration: voting: false - job: @@ -28,3 +28,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..b6d985db --- /dev/null +++ b/playbooks/sahara-dashboard-integration/run.yaml @@ -0,0 +1,11 @@ +--- +- hosts: all + strategy: linear + roles: + - orchestrate-devstack + +- hosts: controller + roles: + - post-devstack-sahara-ui-integration + - role: tox + 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()