Fix broken tests
This fixes the tests by reuseing the more modern approach for handling settings from the heat_dashboard. Finally we remove the base designate jobs, as they do not make use of the dashboard. Change-Id: I53fd7bd0d01680c0bd59ad19365ceede0125050a
This commit is contained in:
parent
ff276852c6
commit
858de8f703
@ -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
|
||||
|
@ -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))
|
||||
|
4
tox.ini
4
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user