Merge "Switch integration tests to run with python3"

This commit is contained in:
Zuul 2019-03-06 02:13:11 +00:00 committed by Gerrit Code Review
commit 396ee88ef2
4 changed files with 19 additions and 5 deletions

View File

@ -39,7 +39,7 @@
vars:
devstack_services:
horizon: true
tox_envlist: py27integration
tox_envlist: integration
- job:
name: horizon-dsvm-tempest-plugin

View File

@ -200,6 +200,9 @@ class BaseTestCase(testtools.TestCase):
super(BaseTestCase, self).addOnException(wrapped_handler)
def __hash__(self):
return hash((type(self), self._testMethodName))
def _configure_log(self):
"""Configure log to capture test logs include selenium logs.

View File

@ -10,6 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import functools
import importlib
import json
@ -316,7 +317,17 @@ class Navigation(object):
def _create_go_to_method(cls, path, class_name=None):
go_to_method = Navigation.GoToMethodFactory(path, class_name)
inst_method = six.create_unbound_method(go_to_method, Navigation)
setattr(Navigation, inst_method.name, inst_method)
# TODO(e0ne): remove python2 support once all integration jobs
# will be switched to python3.
if six.PY3:
def _go_to_page(self, path):
return Navigation._go_to_page(self, path)
wrapped_go_to = functools.partialmethod(_go_to_page, path)
setattr(Navigation, inst_method.name, wrapped_go_to)
else:
setattr(Navigation, inst_method.name, inst_method)
@classmethod
def unify_page_path(cls, path, preserve_spaces=True):

View File

@ -107,15 +107,15 @@ setenv =
SKIP_UNITTESTS=1
commands = {[unit_tests]commands}
[testenv:py27integration]
envdir = {toxworkdir}/py27
[testenv:integration]
basepython = python3
envdir = {toxworkdir}/venv
# Run integration tests only
passenv = AVCONV_INSTALLED
setenv =
PYTHONHASHSEED=0
INTEGRATION_TESTS=1
SELENIUM_HEADLESS=1
basepython = python2.7
commands = {envpython} {toxinidir}/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings --verbosity 2 --tag integration {posargs}
[testenv:npm]