Fix tox and tests
Fixes a bunch of missing __init__.py files to make the docs job pass without warnings, also cleans up tox (to move away from run_tests) Change-Id: If305c701b4d601e66f1f9987d2dd70d6634ea624
This commit is contained in:
parent
2ecf2dd110
commit
1b398928f8
@ -0,0 +1,16 @@
|
||||
# Copyright 2016 Cisco Systems
|
||||
#
|
||||
# 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.
|
||||
|
||||
# Import REST modules here
|
||||
from . import magnum # noqa
|
@ -14,10 +14,6 @@
|
||||
|
||||
from django.views import generic
|
||||
|
||||
# DO NOT REMOVE
|
||||
# This needs for register url of API.
|
||||
from magnum_ui.api.rest import magnum # noqa
|
||||
|
||||
|
||||
class IndexView(generic.TemplateView):
|
||||
template_name = 'angular.html'
|
||||
|
0
magnum_ui/enabled/__init__.py
Normal file
0
magnum_ui/enabled/__init__.py
Normal file
0
magnum_ui/test/api_tests/__init__.py
Normal file
0
magnum_ui/test/api_tests/__init__.py
Normal file
39
magnum_ui/test/settings.py
Normal file
39
magnum_ui/test/settings.py
Normal file
@ -0,0 +1,39 @@
|
||||
# Copyright 2016 Cisco Systems, Inc.
|
||||
#
|
||||
# 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.
|
||||
|
||||
# Default to Horizons test settings to avoid any missing keys
|
||||
from horizon.test.settings import * # noqa
|
||||
from openstack_dashboard.test.settings import * # noqa
|
||||
|
||||
# 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)
|
||||
|
||||
# Update the dashboards with magnum_ui
|
||||
import magnum_ui.enabled
|
||||
import openstack_dashboard.enabled
|
||||
from openstack_dashboard.utils import settings
|
||||
|
||||
settings.update_dashboards(
|
||||
[
|
||||
magnum_ui.enabled,
|
||||
openstack_dashboard.enabled,
|
||||
],
|
||||
HORIZON_CONFIG,
|
||||
INSTALLED_APPS
|
||||
)
|
||||
|
||||
# Ensure any duplicate apps are removed after the update_dashboards call
|
||||
INSTALLED_APPS = list(set(INSTALLED_APPS))
|
@ -21,3 +21,8 @@ classifier =
|
||||
[files]
|
||||
packages =
|
||||
magnum_ui
|
||||
|
||||
[build_sphinx]
|
||||
all_files = 1
|
||||
build-dir = doc/build
|
||||
source-dir = doc/source
|
||||
|
30
tox.ini
30
tox.ini
@ -1,5 +1,5 @@
|
||||
[tox]
|
||||
envlist = py27,py27dj18,pep834
|
||||
envlist = py27,py27dj18,pep8,py34
|
||||
minversion = 1.6
|
||||
skipsdist = True
|
||||
|
||||
@ -11,42 +11,28 @@ setenv = VIRTUAL_ENV={envdir}
|
||||
NOSE_OPENSTACK_RED=0.05
|
||||
NOSE_OPENSTACK_YELLOW=0.025
|
||||
NOSE_OPENSTACK_SHOW_ELAPSED=1
|
||||
# Note the hash seed is set to 0 until horizon can be tested with a
|
||||
# random hash seed successfully.
|
||||
PYTHONHASHSEED=0
|
||||
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -U {opts} {packages}
|
||||
deps = -r{toxinidir}/requirements.txt
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
commands = /bin/bash run_tests.sh -N --no-pep8 {posargs}
|
||||
commands = python manage.py test {posargs} --settings=magnum_ui.test.settings
|
||||
|
||||
[testenv:pep8]
|
||||
commands =
|
||||
/bin/bash run_tests.sh -N --pep8
|
||||
/bin/bash run_tests.sh -N --makemessages --check-only
|
||||
commands = flake8 {posargs}
|
||||
|
||||
[testenv:venv]
|
||||
commands = {posargs}
|
||||
|
||||
[testenv:cover]
|
||||
commands = /bin/bash run_tests.sh -N --no-pep8 --coverage {posargs}
|
||||
commands = python setup.py test --coverage --testr-args='{posargs}'
|
||||
|
||||
[testenv:py27dj18]
|
||||
basepython = python2.7
|
||||
commands = pip install django>=1.8,<1.9
|
||||
/bin/bash run_tests.sh -N --no-pep8 {posargs}
|
||||
|
||||
[testenv:py27integration]
|
||||
basepython = python2.7
|
||||
commands = /bin/bash run_tests.sh -N --integration --selenium-headless {posargs}
|
||||
|
||||
[testenv:eslint]
|
||||
passenv = *
|
||||
commands = nodeenv -p
|
||||
npm install
|
||||
/bin/bash run_tests.sh -N --eslint
|
||||
commands =
|
||||
pip install django>=1.8,<1.9
|
||||
python manage.py test {posargs} --settings=magnum_ui.test.settings
|
||||
|
||||
[testenv:docs]
|
||||
setenv = DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings
|
||||
setenv = DJANGO_SETTINGS_MODULE=magnum_ui.test.settings
|
||||
commands = python setup.py build_sphinx
|
||||
|
||||
[flake8]
|
||||
|
Loading…
Reference in New Issue
Block a user