2012-05-26 18:58:14 +00:00
|
|
|
[tox]
|
2015-07-13 10:13:33 +00:00
|
|
|
envlist = py27,py27dj17,py27dj18,pep8,py34
|
2013-12-09 14:17:48 +00:00
|
|
|
minversion = 1.6
|
|
|
|
skipsdist = True
|
2012-05-26 18:58:14 +00:00
|
|
|
|
|
|
|
[testenv]
|
2013-12-09 14:17:48 +00:00
|
|
|
usedevelop = True
|
2015-01-13 23:08:34 +00:00
|
|
|
install_command = pip install -U {opts} {packages}
|
2012-05-26 18:58:14 +00:00
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
|
|
NOSE_WITH_OPENSTACK=1
|
|
|
|
NOSE_OPENSTACK_COLOR=1
|
|
|
|
NOSE_OPENSTACK_RED=0.05
|
|
|
|
NOSE_OPENSTACK_YELLOW=0.025
|
|
|
|
NOSE_OPENSTACK_SHOW_ELAPSED=1
|
2014-07-28 15:03:51 +00:00
|
|
|
# Note the hash seed is set to 0 until horizon can be tested with a
|
|
|
|
# random hash seed successfully.
|
|
|
|
PYTHONHASHSEED=0
|
2013-05-28 08:06:10 +00:00
|
|
|
deps = -r{toxinidir}/requirements.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
2014-04-10 15:39:21 +00:00
|
|
|
commands = /bin/bash run_tests.sh -N --no-pep8 {posargs}
|
2012-05-26 18:58:14 +00:00
|
|
|
|
2015-08-28 14:14:23 +00:00
|
|
|
[testenv:py34]
|
|
|
|
commands =
|
|
|
|
python manage.py test --settings=horizon.test.settings \
|
2015-09-07 10:03:57 +00:00
|
|
|
horizon.test.tests.base \
|
2015-08-28 15:12:14 +00:00
|
|
|
horizon.test.tests.forms \
|
2015-09-07 13:20:36 +00:00
|
|
|
horizon.test.tests.messages \
|
2015-08-28 14:14:23 +00:00
|
|
|
horizon.test.tests.middleware \
|
|
|
|
horizon.test.tests.tables.DataTableViewTests \
|
|
|
|
horizon.test.tests.templatetags \
|
|
|
|
horizon.test.tests.test_file_discovery \
|
|
|
|
horizon.test.tests.utils.FiltersTests \
|
|
|
|
horizon.test.tests.utils.GetPageSizeTests \
|
|
|
|
horizon.test.tests.utils.MemoizedTests \
|
|
|
|
horizon.test.tests.utils.TimeSinceNeverFilterTests \
|
|
|
|
horizon.test.tests.utils.ValidatorsTests \
|
|
|
|
horizon.test.tests.views
|
|
|
|
python manage.py test --settings=openstack_dashboard.test.settings \
|
2015-08-28 15:42:53 +00:00
|
|
|
openstack_dashboard.dashboards.project.access_and_security.api_access.tests \
|
2015-08-28 14:14:23 +00:00
|
|
|
openstack_dashboard.dashboards.project.images.images.tests.CreateImageFormTests \
|
|
|
|
openstack_dashboard.dashboards.project.images.tests.ImagesAndSnapshotsUtilsTests \
|
|
|
|
openstack_dashboard.dashboards.project.stacks.tests.TemplateFormTests \
|
2015-08-28 14:56:03 +00:00
|
|
|
openstack_dashboard.dashboards.settings.password \
|
2015-08-28 14:14:23 +00:00
|
|
|
openstack_dashboard.test.api_tests.base_tests.APIDictWrapperTests \
|
|
|
|
openstack_dashboard.test.api_tests.base_tests.APIResourceWrapperTests \
|
|
|
|
openstack_dashboard.test.api_tests.base_tests.ApiHelperTests \
|
|
|
|
openstack_dashboard.test.api_tests.base_tests.ApiVersionTests \
|
|
|
|
openstack_dashboard.test.api_tests.base_tests.QuotaSetTests \
|
|
|
|
openstack_dashboard.test.api_tests.ceilometer_tests \
|
|
|
|
openstack_dashboard.test.api_tests.cinder_tests \
|
2015-08-28 14:49:15 +00:00
|
|
|
openstack_dashboard.test.api_tests.config_rest_tests \
|
2015-08-28 14:14:23 +00:00
|
|
|
openstack_dashboard.test.api_tests.fwaas_tests \
|
|
|
|
openstack_dashboard.test.api_tests.keystone_tests \
|
|
|
|
openstack_dashboard.test.api_tests.lbaas_tests \
|
|
|
|
openstack_dashboard.test.api_tests.neutron_rest_tests.NeutronPortsTestCase \
|
|
|
|
openstack_dashboard.test.api_tests.nova_tests \
|
|
|
|
openstack_dashboard.test.test_plugins.panel_group_tests.PanelGroupPluginTests \
|
|
|
|
openstack_dashboard.test.test_plugins.panel_tests.PanelPluginTests \
|
2015-08-28 15:01:46 +00:00
|
|
|
openstack_dashboard.test.tests.error_pages \
|
2015-08-28 14:14:23 +00:00
|
|
|
openstack_dashboard.test.tests.policy \
|
|
|
|
openstack_dashboard.test.tests.policy_backend \
|
|
|
|
openstack_dashboard.test.tests.utils
|
|
|
|
|
2012-05-26 18:58:14 +00:00
|
|
|
[testenv:pep8]
|
2014-10-09 20:16:31 +00:00
|
|
|
commands =
|
|
|
|
/bin/bash run_tests.sh -N --pep8
|
|
|
|
/bin/bash run_tests.sh -N --makemessages --check-only
|
2012-05-26 18:58:14 +00:00
|
|
|
|
|
|
|
[testenv:venv]
|
|
|
|
commands = {posargs}
|
|
|
|
|
|
|
|
[testenv:cover]
|
2014-04-10 15:39:21 +00:00
|
|
|
commands = /bin/bash run_tests.sh -N --no-pep8 --coverage {posargs}
|
2012-05-26 18:58:14 +00:00
|
|
|
|
2015-07-13 10:13:33 +00:00
|
|
|
[testenv:py27dj17]
|
2013-05-28 14:43:34 +00:00
|
|
|
basepython = python2.7
|
2015-07-13 10:13:33 +00:00
|
|
|
commands = pip install django>=1.7,<1.8
|
2014-04-10 15:39:21 +00:00
|
|
|
/bin/bash run_tests.sh -N --no-pep8 {posargs}
|
2013-05-28 14:43:34 +00:00
|
|
|
|
2015-07-13 10:13:33 +00:00
|
|
|
# Django-1.8 is LTS
|
|
|
|
[testenv:py27dj18]
|
2014-02-10 19:47:53 +00:00
|
|
|
basepython = python2.7
|
2015-07-13 10:13:33 +00:00
|
|
|
commands = pip install django>=1.8,<1.9
|
2014-04-10 15:39:21 +00:00
|
|
|
/bin/bash run_tests.sh -N --no-pep8 {posargs}
|
2014-02-10 19:47:53 +00:00
|
|
|
|
2013-01-10 14:13:59 +00:00
|
|
|
[testenv:py27integration]
|
|
|
|
basepython = python2.7
|
2014-08-11 13:06:28 +00:00
|
|
|
commands = /bin/bash run_tests.sh -N --integration --selenium-headless {posargs}
|
2013-01-10 14:13:59 +00:00
|
|
|
|
Switched from JSCS to ESLint
This patch switches horizon from using JSCS to using ESlint. It
adds the john papa style guides as an eslint plugin, and deactivates
additional linting rules so current cleanup efforts can focus on the
issues remaining from JSCS. Once that cleanup effort is complete,
we can switch our linting job to voting and move forward from there.
YAML for .eslintrc was chosen because the JSON specification does
not allow comments, and having comments (including rule links) will
make it easier to discuss linting changes.
Deactivated eslint rules have each been annotated with a # TODO
statement, so we can address them in the future. Links in the
documentation have been updated to new contributor guidelines, which
will be updated after this patch lands.
Linting may be executed by first installing npm dependencies using
`npm install`, and then executing `npm run lint` at any time in the
future. No python venv is required.
For clarification: We are switching to ESLint because JSCS explicitly
focuses on code-style, not on language use errors. For that purpose,
JSCS explicitly defers to JSHint, which due to the 'do no evil' license is
not usable. Since ESLint provides both the codestyle functionality, and
the language use checks, of both JSCS and JSHint, it was deemed the
only viable tool,
http://lists.openstack.org/pipermail/openstack-dev/2015-June/067030.html
Change-Id: Ib4c3f77f8cc3cdaa3c7558b7bc3a6d1299b6dcbe
Partially-Implements: blueprint jscs-cleanup
2015-06-16 17:27:59 +00:00
|
|
|
[testenv:eslint]
|
2015-05-26 19:16:22 +00:00
|
|
|
passenv = *
|
2015-04-02 16:37:32 +00:00
|
|
|
commands = nodeenv -p
|
Switched from JSCS to ESLint
This patch switches horizon from using JSCS to using ESlint. It
adds the john papa style guides as an eslint plugin, and deactivates
additional linting rules so current cleanup efforts can focus on the
issues remaining from JSCS. Once that cleanup effort is complete,
we can switch our linting job to voting and move forward from there.
YAML for .eslintrc was chosen because the JSON specification does
not allow comments, and having comments (including rule links) will
make it easier to discuss linting changes.
Deactivated eslint rules have each been annotated with a # TODO
statement, so we can address them in the future. Links in the
documentation have been updated to new contributor guidelines, which
will be updated after this patch lands.
Linting may be executed by first installing npm dependencies using
`npm install`, and then executing `npm run lint` at any time in the
future. No python venv is required.
For clarification: We are switching to ESLint because JSCS explicitly
focuses on code-style, not on language use errors. For that purpose,
JSCS explicitly defers to JSHint, which due to the 'do no evil' license is
not usable. Since ESLint provides both the codestyle functionality, and
the language use checks, of both JSCS and JSHint, it was deemed the
only viable tool,
http://lists.openstack.org/pipermail/openstack-dev/2015-June/067030.html
Change-Id: Ib4c3f77f8cc3cdaa3c7558b7bc3a6d1299b6dcbe
Partially-Implements: blueprint jscs-cleanup
2015-06-16 17:27:59 +00:00
|
|
|
npm install
|
|
|
|
/bin/bash run_tests.sh -N --eslint
|
2015-04-02 16:37:32 +00:00
|
|
|
|
2014-04-04 11:49:14 +00:00
|
|
|
[testenv:docs]
|
2014-06-13 00:00:19 +00:00
|
|
|
setenv = DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings
|
2014-04-04 11:49:14 +00:00
|
|
|
commands = python setup.py build_sphinx
|
|
|
|
|
2012-05-26 18:58:14 +00:00
|
|
|
[tox:jenkins]
|
|
|
|
downloadcache = ~/cache/pip
|
|
|
|
|
2013-04-21 06:22:39 +00:00
|
|
|
[flake8]
|
2014-08-19 18:32:02 +00:00
|
|
|
exclude = .venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,build,panel_template,dash_template,local_settings.py,*/local/*,*/test/test_plugins/*,.ropeproject
|
2014-09-30 13:41:11 +00:00
|
|
|
# H405 multi line docstring summary not separated with an empty line
|
2015-02-05 02:56:23 +00:00
|
|
|
ignore = H405
|
2015-03-30 10:30:17 +00:00
|
|
|
max-complexity = 20
|
2014-01-03 16:31:49 +00:00
|
|
|
|
|
|
|
[hacking]
|
|
|
|
import_exceptions = collections.defaultdict,
|
2015-08-13 08:01:32 +00:00
|
|
|
collections.OrderedDict,
|
2014-01-03 16:31:49 +00:00
|
|
|
django.conf.settings,
|
2014-09-25 12:13:02 +00:00
|
|
|
django.conf.urls.include,
|
2014-09-16 10:07:57 +00:00
|
|
|
django.conf.urls.patterns,
|
|
|
|
django.conf.urls.url,
|
2014-01-03 16:31:49 +00:00
|
|
|
django.core.urlresolvers.reverse,
|
|
|
|
django.core.urlresolvers.reverse_lazy,
|
|
|
|
django.template.loader.render_to_string,
|
2014-01-28 11:36:08 +00:00
|
|
|
django.test.utils.override_settings,
|
2014-07-16 15:50:03 +00:00
|
|
|
django.utils.encoding.force_text,
|
2014-01-03 16:31:49 +00:00
|
|
|
django.utils.html.conditional_escape,
|
|
|
|
django.utils.html.escape,
|
|
|
|
django.utils.http.urlencode,
|
|
|
|
django.utils.safestring.mark_safe,
|
Allow translators to translate BatchActions
Currently BatchAction proposes only an action_present and action_past verb
to be concatenated with a data_type_singular or data_type_plural string.
The issue is that many languages need to conjugate the verb with the
plural/singular subject, and some translations where terribly awfull and
impossible to do.
Indeed, some languages have up to 5 plural forms depending on the number of
items.
This patch introduces the fact that action_present is a method instead of an
attribute, which in conjonction with https://review.openstack.org/57701 allows
better translation to be performed.
This patch also adds contextual mrkers to STATUS_DISPLAY_CHOICES,
TASK_DISPLAY_CHOICES and POWER_DISPLAY_CHOICES because it was impossible to
translate the stand-alone words out of context for a translator (i.e. the word
"active" will be translated differently if the active object is feminine or
masculine, since feminine and masculine depends also on the language, it is
mission impossible for the translator to translate "active" if he does not know
"what" is "active").
It is important to use unicode strings with contextual markers because of the
following django bug:
https://code.djangoproject.com/ticket/22565
The django community was very quick and responsive and fixed the bug very fast:
https://code.djangoproject.com/changeset/142c27218a0bb07bb197faab7b1d8eb3a084f5b9
and back-ported their fix in the 1.6 and 1.7 django branches:
https://code.djangoproject.com/changeset/61fd00d4fd65f44d0a05be4c7e95124e4102ec27
https://code.djangoproject.com/changeset/034866204b39f797c73997b03cd90443aa03aa91
but since in horizon we support back to django 1.4, we will have to live with
it by providing unicode strings until we drop support of old django versions.
We can't introduce contextual markers and ungettext (pluralization) verywhere
at once because Translators would totally loose their previous work. So we have
to progressively introduce contextual markers and pluralization, when a string
is changed, or for new strings. It is also the reason why this patch changes
only the strings of the instance view actions.
Since we can't use contextual markers and pluralization for all the code at
once, this patch partially:
partial-bug: 1307476
Change-Id: I4cef42dc4a12f55cf750d9a18083254c6a96e716
2014-04-30 11:35:49 +00:00
|
|
|
django.utils.translation.npgettext_lazy,
|
2014-01-03 16:31:49 +00:00
|
|
|
django.utils.translation.pgettext_lazy,
|
|
|
|
django.utils.translation.ugettext_lazy,
|
|
|
|
django.utils.translation.ungettext_lazy,
|
|
|
|
operator.attrgetter,
|
|
|
|
StringIO.StringIO
|