Add ironic-ui integration tests

This patch adds basic tests to verify that ironic-ui is
installed and could be opened.

ironic-ui-integration-tests job is added in a
non-voting mode.

Depends-On: https://review.openstack.org/634712
Change-Id: Ie77be522679c9076ccbfb133eadaae7228adb03c
This commit is contained in:
Ivan Kolodyazhny 2019-02-07 04:15:21 -08:00
parent 51db938545
commit d73528db1d
12 changed files with 101 additions and 1 deletions

View File

@ -1,3 +1,26 @@
- job:
name: ironic-ui-integration-tests
parent: horizon-integration-tests
required-projects:
- name: openstack/horizon
- name: openstack/ironic
- name: openstack/python-ironicclient
- name: openstack/ironic-ui
roles:
- zuul: openstack-infra/devstack
- zuul: openstack/horizon
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
- ^releasenotes/.*$
vars:
devstack_plugins:
ironic: https://git.openstack.org/openstack/ironic
ironic-ui: https://git.openstack.org/openstack/ironic-ui
devstack_services:
horizon: true
tox_envlist: integration
- project: - project:
templates: templates:
- check-requirements - check-requirements
@ -8,3 +31,7 @@
- openstack-python36-jobs - openstack-python36-jobs
- publish-openstack-docs-pti - publish-openstack-docs-pti
- release-notes-jobs-python3 - release-notes-jobs-python3
check:
jobs:
- ironic-ui-integration-tests:
voting: false

6
bindep.txt Normal file
View File

@ -0,0 +1,6 @@
# selenium tests
firefox [selenium]
xvfb [selenium platform:dpkg]
# already part of xorg-x11-server on openSUSE
xorg-x11-server-Xvfb [selenium platform:redhat]

View File

View File

@ -0,0 +1,5 @@
[plugin]
is_plugin=True
plugin_page_path=ironic_ui.test.integration.pages
plugin_page_structure='{"Admin": {"System": {"_": ["Ironic Bare Metal Provisioning"]}}}'

View File

@ -0,0 +1,21 @@
#
# 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.
from openstack_dashboard.test.integration_tests.pages import basepage
class IronicbaremetalprovisioningPage(basepage.BaseNavigationPage):
def __init__(self, driver, conf):
super(IronicbaremetalprovisioningPage, self).__init__(driver, conf)
self._page_title = "Ironic Bare Metal Provisioning"

View File

@ -0,0 +1,23 @@
#
# 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.
from openstack_dashboard.test.integration_tests import helpers
class TestIronicDashboardInstalled(helpers.AdminTestCase):
def test_ironic_bare_metal_provisioning_page_opened(self):
ironic_page = (
self.home_pg.go_to_admin_system_ironicbaremetalprovisioningpage())
title = 'Ironic Bare Metal Provisioning - OpenStack Dashboard'
self.assertEqual(ironic_page.page_title, title)

View File

@ -89,6 +89,7 @@ requests==2.18.4
requestsexceptions==1.4.0 requestsexceptions==1.4.0
rfc3986==1.1.0 rfc3986==1.1.0
rjsmin==1.0.12 rjsmin==1.0.12
selenium==2.50.1
semantic-version==2.6.0 semantic-version==2.6.0
simplejson==3.13.2 simplejson==3.13.2
six==1.11.0 six==1.11.0
@ -133,3 +134,4 @@ XStatic-Spin==1.2.5.2
XStatic-term.js==0.0.7.0 XStatic-term.js==0.0.7.0
XStatic-tv4==1.2.7.0 XStatic-tv4==1.2.7.0
XStatic==1.0.1 XStatic==1.0.1
xvfbwrapper==0.1.3

View File

@ -17,3 +17,7 @@ openstackdocstheme>=1.18.1 # Apache-2.0
reno>=2.5.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0
# Include horizon as test requirement # Include horizon as test requirement
http://tarballs.openstack.org/horizon/horizon-master.tar.gz#egg=horizon http://tarballs.openstack.org/horizon/horizon-master.tar.gz#egg=horizon
# integration tests requirements
selenium>=2.50.1 # Apache-2.0
xvfbwrapper>=0.1.3 #license: MIT

14
tox.ini
View File

@ -15,7 +15,19 @@ setenv = VIRTUAL_ENV={envdir}
DJANGO_SETTINGS_MODULE=ironic_ui.test.settings DJANGO_SETTINGS_MODULE=ironic_ui.test.settings
deps = -r{toxinidir}/requirements.txt deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
commands = {toxinidir}/manage.py test ironic_ui --settings=ironic_ui.test.settings commands = {toxinidir}/manage.py test ironic_ui --settings=ironic_ui.test.settings --exclude-tag integration
[testenv:integration]
# Run integration tests only
passenv = AVCONV_INSTALLED
setenv =
PYTHONHASHSEED=0
INTEGRATION_TESTS=1
SELENIUM_HEADLESS=1
HORIZON_INTEGRATION_TESTS_CONFIG_FILE=ironic_ui/test/integration/horizon.conf
basepython = python2.7
commands = python manage.py test ironic_ui.test.integration --settings=ironic_ui.test.settings --tag integration
[testenv:pep8] [testenv:pep8]
basepython = python3 basepython = python3