[dashboard][tests] nosetests setup.py target is misleading and doesn't work

Bug #1618905 reported by Kirill Zaitsev on 2016-08-31
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Murano
Medium
Unassigned

Bug Description

$ PYTHONPATH='../horizon/' DJANGO_SETTINGS_MODULE=muranodashboard.tests.settings python setup.py nosetests
running nosetests
running egg_info
writing pbr to murano_dashboard.egg-info/pbr.json
writing requirements to murano_dashboard.egg-info/requires.txt
writing murano_dashboard.egg-info/PKG-INFO
writing top-level names to murano_dashboard.egg-info/top_level.txt
writing dependency_links to murano_dashboard.egg-info/dependency_links.txt
[pbr] Processing SOURCES.txt
[pbr] In git context, generating filelist from git
warning: no files found matching 'AUTHORS'
warning: no files found matching 'ChangeLog'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
writing manifest file 'murano_dashboard.egg-info/SOURCES.txt'
Failure: AppRegistryNotReady (The translation infrastructure cannot be initialized before the apps registry is ready. Check that you don't make non-lazy gettext calls at import time.) ... ERROR
muranodashboard.tests.unit.dynamic_ui.test_helpers.TestHelper.test_int2base ... ok
muranodashboard.tests.unit.dynamic_ui.test_helpers.TestHelper.test_to_str ... ok
muranodashboard.tests.unit.dynamic_ui.test_services.TestService.test_service_field_hidden_false ... ok
muranodashboard.tests.unit.dynamic_ui.test_services.TestService.test_service_field_hidden_true ... ok
muranodashboard.tests.unit.dynamic_ui.test_versions.TestVersions.test_exact_match ... ok
muranodashboard.tests.unit.dynamic_ui.test_versions.TestVersions.test_get_latest_as_semver ... ok
muranodashboard.tests.unit.dynamic_ui.test_versions.TestVersions.test_newer ... ok
muranodashboard.tests.unit.dynamic_ui.test_versions.TestVersions.test_older_in_family ... ok
muranodashboard.tests.unit.dynamic_ui.test_versions.TestVersions.test_oldest_in_family ... ok
muranodashboard.tests.unit.dynamic_ui.test_versions.TestVersions.test_uncompatible_new ... ok
muranodashboard.tests.unit.dynamic_ui.test_versions.TestVersions.test_uncompatible_old ... ok
muranodashboard.tests.unit.dynamic_ui.test_yaql_functions.TestYAQLFunctions.test_generate_hostname ... ok
muranodashboard.tests.unit.dynamic_ui.test_yaql_functions.TestYAQLFunctions.test_generate_hostname_random ... ok
ERROR
ERROR
ERROR
ERROR
muranodashboard.tests.test_utils.BunchTests.test_del_attr ... ok
muranodashboard.tests.test_utils.BunchTests.test_del_item ... ok
muranodashboard.tests.test_utils.BunchTests.test_get_attr ... ok
muranodashboard.tests.test_utils.BunchTests.test_get_item ... ok
muranodashboard.tests.test_utils.BunchTests.test_in ... ok
muranodashboard.tests.test_utils.BunchTests.test_iteration ... ok
muranodashboard.tests.test_utils.BunchTests.test_set_attr ... ok
muranodashboard.tests.test_utils.BunchTests.test_set_item ... ok

======================================================================
ERROR: Failure: AppRegistryNotReady (The translation infrastructure cannot be initialized before the apps registry is ready. Check that you don't make non-lazy gettext calls at import time.)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/Users/teferi/murano/murano-dashboard/muranodashboard/api/rest/__init__.py", line 14, in <module>
    from . import packages # noqa
  File "/Users/teferi/murano/murano-dashboard/muranodashboard/api/rest/packages.py", line 16, in <module>
    from openstack_dashboard.api.rest import utils as rest_utils
  File "/Users/teferi/murano/horizon/openstack_dashboard/api/rest/__init__.py", line 25, in <module>
    from . import cinder # noqa
  File "/Users/teferi/murano/horizon/openstack_dashboard/api/rest/cinder.py", line 23, in <module>
    from openstack_dashboard.usage import quotas
  File "/Users/teferi/murano/horizon/openstack_dashboard/usage/__init__.py", line 20, in <module>
    from openstack_dashboard.usage.tables import BaseUsageTable # noqa
  File "/Users/teferi/murano/horizon/openstack_dashboard/usage/tables.py", line 42, in <module>
    class GlobalUsageTable(BaseUsageTable):
  File "/Users/teferi/murano/horizon/horizon/tables/base.py", line 1086, in __new__
    dt_attrs["_meta"] = opts = DataTableOptions(attrs.get("Meta", None))
  File "/Users/teferi/murano/horizon/horizon/tables/base.py", line 995, in __init__
    verbose_name = (getattr(options, 'verbose_name', None)
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/utils/functional.py", line 135, in __wrapper__
    res = func(*self.__args, **self.__kw)
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 84, in ugettext
    return _trans.ugettext(message)
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 330, in ugettext
    return do_translate(message, 'ugettext')
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 307, in do_translate
    _default = _default or translation(settings.LANGUAGE_CODE)
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 209, in translation
    _translations[language] = DjangoTranslation(language)
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 118, in __init__
    self._add_installed_apps_translations()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 159, in _add_installed_apps_translations
    "The translation infrastructure cannot be initialized before the "
AppRegistryNotReady: The translation infrastructure cannot be initialized before the apps registry is ready. Check that you don't make non-lazy gettext calls at import time.
-------------------- >> begin captured logging << --------------------
muranodashboard.common.cache: INFO: Using apps cache directory located at /var/folders/yq/lck68_m13zjgk_hdj_kx8dgc0000gn/T/muranodashboard-cache/apps
muranodashboard.dynamic_ui.services: INFO: Using cache directory located at /var/folders/yq/lck68_m13zjgk_hdj_kx8dgc0000gn/T/muranodashboard-cache
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: test suite for <class 'muranodashboard.tests.test_fields.TestFlavorField'>
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/nose/suite.py", line 209, in run
    self.setUp()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/nose/suite.py", line 292, in setUp
    self.setupContext(ancestor)
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/nose/suite.py", line 315, in setupContext
    try_run(context, names)
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/nose/util.py", line 471, in try_run
    return func()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/test/testcases.py", line 948, in setUpClass
    cls.cls_atomics = cls._enter_atomics()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/test/testcases.py", line 933, in _enter_atomics
    atomics[db_name].__enter__()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/db/transaction.py", line 150, in __enter__
    if not connection.get_autocommit():
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 286, in get_autocommit
    self.ensure_connection()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
    self.connect()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 118, in connect
    conn_params = self.get_connection_params()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 177, in get_connection_params
    "settings.DATABASES is improperly configured. "
ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the NAME value.

======================================================================
ERROR: test suite for <class 'muranodashboard.tests.test_fields.TestPasswordField'>
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/nose/suite.py", line 209, in run
    self.setUp()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/nose/suite.py", line 292, in setUp
    self.setupContext(ancestor)
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/nose/suite.py", line 315, in setupContext
    try_run(context, names)
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/nose/util.py", line 471, in try_run
    return func()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/test/testcases.py", line 948, in setUpClass
    cls.cls_atomics = cls._enter_atomics()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/test/testcases.py", line 933, in _enter_atomics
    atomics[db_name].__enter__()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/db/transaction.py", line 150, in __enter__
    if not connection.get_autocommit():
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 286, in get_autocommit
    self.ensure_connection()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
    self.connect()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 118, in connect
    conn_params = self.get_connection_params()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 177, in get_connection_params
    "settings.DATABASES is improperly configured. "
ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the NAME value.

======================================================================
ERROR: test suite for <class 'muranodashboard.tests.test_tabs.TestLicenseTab'>
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/nose/suite.py", line 209, in run
    self.setUp()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/nose/suite.py", line 292, in setUp
    self.setupContext(ancestor)
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/nose/suite.py", line 315, in setupContext
    try_run(context, names)
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/nose/util.py", line 471, in try_run
    return func()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/test/testcases.py", line 948, in setUpClass
    cls.cls_atomics = cls._enter_atomics()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/test/testcases.py", line 933, in _enter_atomics
    atomics[db_name].__enter__()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/db/transaction.py", line 150, in __enter__
    if not connection.get_autocommit():
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 286, in get_autocommit
    self.ensure_connection()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
    self.connect()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 118, in connect
    conn_params = self.get_connection_params()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 177, in get_connection_params
    "settings.DATABASES is improperly configured. "
ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the NAME value.

======================================================================
ERROR: test suite for <class 'muranodashboard.tests.test_tabs.TestRequirementsTab'>
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/nose/suite.py", line 209, in run
    self.setUp()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/nose/suite.py", line 292, in setUp
    self.setupContext(ancestor)
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/nose/suite.py", line 315, in setupContext
    try_run(context, names)
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/nose/util.py", line 471, in try_run
    return func()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/test/testcases.py", line 948, in setUpClass
    cls.cls_atomics = cls._enter_atomics()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/test/testcases.py", line 933, in _enter_atomics
    atomics[db_name].__enter__()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/db/transaction.py", line 150, in __enter__
    if not connection.get_autocommit():
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 286, in get_autocommit
    self.ensure_connection()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
    self.connect()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 118, in connect
    conn_params = self.get_connection_params()
  File "/Users/teferi/murano/horizon/.tox/venv/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 177, in get_connection_params
    "settings.DATABASES is improperly configured. "
ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the NAME value.

----------------------------------------------------------------------
Ran 22 tests in 2.179s

FAILED (errors=5)

Changed in murano:
milestone: newton-3 → newton-rc1
Changed in murano:
milestone: newton-rc1 → newton-rc2
Changed in murano:
milestone: newton-rc2 → ocata-1
zhurong (zhu-rong) on 2017-01-06
Changed in murano:
assignee: nobody → zhurong (zhu-rong)
zhurong (zhu-rong) on 2017-01-06
Changed in murano:
assignee: zhurong (zhu-rong) → nobody
zhurong (zhu-rong) on 2017-01-06
Changed in murano:
assignee: nobody → zhurong (zhu-rong)

Fix proposed to branch: master
Review: https://review.openstack.org/417302

Changed in murano:
status: Confirmed → In Progress

Change abandoned by zhurong (<email address hidden>) on branch: master
Review: https://review.openstack.org/417302
Reason: broken the unit test

zhurong (zhu-rong) on 2017-01-06
Changed in murano:
status: In Progress → Confirmed
assignee: zhurong (zhu-rong) → nobody
Changed in murano:
milestone: 3.1.0 → pike-2
Changed in murano:
milestone: pike-2 → pike-rc1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers