diff --git a/.zuul.yaml b/.zuul.yaml index e8ecf15..2a7c0ac 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -2,7 +2,6 @@ templates: - check-requirements - horizon-nodejs10-jobs-nonvoting - - designate-devstack-jobs - openstack-cover-jobs-horizon - openstack-lower-constraints-jobs - openstack-python-jobs-horizon diff --git a/designatedashboard/tests/settings.py b/designatedashboard/tests/settings.py index 56cdd50..8f86bf5 100644 --- a/designatedashboard/tests/settings.py +++ b/designatedashboard/tests/settings.py @@ -11,68 +11,30 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -import socket -SECRET_KEY = 'HELLA_SECRET!' +# Default to Horizons test settings to avoid any missing keys -DATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3', - 'NAME': 'test'}} +import openstack_dashboard.enabled # noqa: F811 +from openstack_dashboard.test.settings import * # noqa: F403,H303 +from openstack_dashboard.utils import settings -from horizon.test.settings import * # noqa +import designatedashboard.enabled -socket.setdefaulttimeout(1) +# pop these keys to avoid log warnings about deprecation +# update_dashboards will populate them anyway +HORIZON_CONFIG.pop('dashboards', None) +HORIZON_CONFIG.pop('default_dashboard', None) -DEBUG = False -TEMPLATE_DEBUG = DEBUG +# Update the dashboards with designatedashboard enabled files +# and current INSTALLED_APPS +settings.update_dashboards( + [ + openstack_dashboard.enabled, + designatedashboard.enabled, + ], + HORIZON_CONFIG, + INSTALLED_APPS +) -TESTSERVER = 'http://testserver' - - -MESSAGE_STORAGE = 'django.contrib.messages.storage.cookie.CookieStorage' - -EMAIL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend' -SESSION_ENGINE = 'django.contrib.sessions.backends.cache' - -OPENSTACK_ADDRESS = "localhost" -OPENSTACK_ADMIN_TOKEN = "openstack" -OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_ADDRESS -OPENSTACK_KEYSTONE_ADMIN_URL = "http://%s:35357/v2.0" % OPENSTACK_ADDRESS -OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member" - -# Silence logging output during tests. -LOGGING = { - 'version': 1, - 'disable_existing_loggers': False, - 'handlers': { - 'null': { - 'level': 'DEBUG', - 'class': 'logging.NullHandler' - }, - }, - 'loggers': { - 'django.db.backends': { - 'handlers': ['null'], - 'propagate': False, - }, - 'horizon': { - 'handlers': ['null'], - 'propagate': False, - }, - 'novaclient': { - 'handlers': ['null'], - 'propagate': False, - }, - 'keystoneclient': { - 'handlers': ['null'], - 'propagate': False, - }, - 'quantum': { - 'handlers': ['null'], - 'propagate': False, - }, - 'nose.plugins.manager': { - 'handlers': ['null'], - 'propagate': False, - } - } -} +# Remove duplicated apps +INSTALLED_APPS = list(set(INSTALLED_APPS)) diff --git a/tox.ini b/tox.ini index 388f1e7..2fe276c 100644 --- a/tox.ini +++ b/tox.ini @@ -45,9 +45,11 @@ commands = python setup.py build_sphinx [flake8] # E123, E125 skipped as they are invalid PEP-8. +# F405 TEMPLATES may be undefined, or defined from star imports. +# (because it is not easy to avoid this in openstack_dashboard.test.settings) show-source = True -ignore = E123,E125 +ignore = E123,E125,F405 builtins = _ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,releasenotes,node_modules