diff --git a/etc/oslo-config-generator/tatu.ini b/etc/oslo-config-generator/tatu.ini new file mode 100644 index 0000000..313c252 --- /dev/null +++ b/etc/oslo-config-generator/tatu.ini @@ -0,0 +1,5 @@ +[DEFAULT] +output_file = etc/tatu.ini.sample +wrap_width = 79 +namespace = tatu +namespace = castellan \ No newline at end of file diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..aaeae0e --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,11 @@ +# The order of packages is significant, because pip processes them in the order +# of appearance. Changing the order has an impact on the overall integration +# process, which may cause wedges in the gate later. + +# Install bounded pep8/pyflakes first, then let flake8 install +hacking<0.11,>=0.10.0 + +coverage>=3.6 # Apache-2.0 +mock>=2.0 # BSD +os-testr>=0.7.0 # Apache-2.0 +bandit>=1.0.1 # Apache-2.0 \ No newline at end of file diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..ea58070 --- /dev/null +++ b/tox.ini @@ -0,0 +1,54 @@ +[tox] +minversion = 1.8 +envlist = pep8,py27,pylint +skipsdist = True + +[testenv] +setenv = VIRTUAL_ENV={envdir} +usedevelop = True +install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} +deps = -r{toxinidir}/test-requirements.txt + -r{toxinidir}/requirements.txt +commands = + find . -type f -name "*.pyc" -delete + rm -rf .testrepository/times.dbm + ostestr {posargs} + +[testenv:pep8] +commands = + flake8 {posargs} . +# {[testenv:genconfig]commands} + +[testenv:genconfig] +sitepackages = False +envdir = {toxworkdir}/pep8 +commands = oslo-config-generator --config-file=etc/oslo-config-generator/tatu.ini + +[testenv:venv] +install_command = pip install -U --force-reinstall {opts} {packages} +commands = {posargs} + +[testenv:cover] +commands = + python setup.py testr --coverage --testr-args='{posargs}' + coverage report + +[flake8] +# Following checks are ignored on purpose. +# +# E251 unexpected spaces around keyword / parameter equals +# reason: no improvement in readability +ignore = E251,D100,D101,D102,D202,D208 +exclude = .git,.venv,.tox,dist,tools,doc,*egg,build +max-complexity=30 + +[testenv:pylint] +deps = + {[testenv]deps} + pylint +commands = + pylint --rcfile=pylintrc --output-format=colorized + +[hacking] +import_exceptions = dragonflow._i18n +local-check-factory = neutron_lib.hacking.checks.factory \ No newline at end of file