diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..33f4d24b --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +*.a +*.egg +*.egg-info +*.o +*.py[co] +*.pyc +*.so +*.sqlite +.*.swp +.coverage +.installed.cfg +.testrepository +.tox +.venv +AUTHORS +ChangeLog +_build +build +cover +develop-eggs +dist +eggs +sdist diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 00000000..826664a4 --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,8 @@ +--- +- project: + check: + jobs: + - openstack-tox-linters: + voting: false + - openstack-tox-pep8: + voting: false diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..e69de29b diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 00000000..f1587f3b --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,6 @@ +bashate >= 0.2 +PyYAML >= 3.1.0 +yamllint >= 0.5.2 +# The following are for py27 and py35 +#mock # BSD +#nose # LGPL diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..1bf6fb0b --- /dev/null +++ b/tox.ini @@ -0,0 +1,98 @@ +[tox] +envlist = linters,pep8 +minversion = 2.3 +skipsdist = True + +[testenv] +basepython = python3 +install_command = pip install -U {opts} {packages} +setenv = VIRTUAL_ENV={envdir} + OS_STDOUT_CAPTURE=1 + OS_STDERR_CAPTURE=1 + OS_TEST_TIMEOUT=60 + PYTHONDONTWRITEBYTECODE=True +commands = find {toxinidir} -type f -not -path '{toxinidir}/.tox/*' -not -path '*/__pycache__/*' -name '*.py[c|o]' -delete +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +[testenv:linters] +whitelist_externals = bash +commands = + bash -c "find {toxinidir} \ + \( -name middleware/io-monitor/recipes-common/io-monitor/io-monitor/io_monitor/test-tools/yaml/* -prune \) \ + -o \( -name .tox -prune \) \ + -o -type f -name '*.yaml' \ + -print0 | xargs -0 yamllint" + bash -c "ls cgcs-patch/bin/*.sh | xargs bashate -v {posargs}" + +[pep8] +# Temporarily ignoring these warnings +# E101 indentation contains mixed spaces and tabs +# E116 unexpected indentation (comment) +# E121 continuation line under-indented for hanging indent +# E122 continuation line missing indentation or outdented +# E123 closing bracket does not match indentation of opening bracket +# E124 closing bracket does not match visual indentation +# E126 continuation line over-indented for hanging indent +# E127 continuation line over-indented for visual indent +# E128 continuation line under-indented for visual indent +# E129 visually indented line with same indent as next logical line +# E203 whitespace before ':' +# E211 whitespace before '(' +# E225 missing whitespace around operator +# E226 missing whitespace around arithmetic operator +# E228 missing whitespace around modulo operator +# E231 missing whitespace after ':' +# E241 multiple spaces after +# E261 at least two spaces before inline comment +# E265 block comment should start with '# ' +# E251 unexpected spaces around keyword / parameter equals +# E302 expected 2 blank lines, found 1 +# E303 too many blank lines +# E501 line too long +# E712 comparison to bool should be reworded + +ignore = E101,E116,E121,E123,E122,E124,E126,E127,E128,E129,E203,E211,E225,E226,E228,E231,E241,E251,E261,E265,E302,E303,E501,E712 + +[testenv:pep8] +usedevelop = False +skip_install = True +deps = + pep8 +commands = + pep8 + +[testenv:venv] +commands = {posargs} + +[nosetests] +verbosity=2 + +[testenv:py27] +basepython = python2.7 +deps = {[testenv]deps} + {toxinidir}/nfv/nfv-client + {toxinidir}/nfv/nfv-common + {toxinidir}/nfv/nfv-plugins + {toxinidir}/nfv/nfv-vim +whitelist_externals = cp + find +recreate = True +commands = {[testenv]commands} + cp -v nfv/nfv-tests/nfv_unit_tests/test_data/nfv_vim_db_18.03_GA {envdir}/ + nosetests --exe -w nfv/nfv-tests/nfv_unit_tests/tests/ '{posargs}' + +[testenv:py35] +basepython = python3 +deps = {[testenv]deps} + nfv/nfv-client + nfv/nfv-common + nfv/nfv-plugins + nfv/nfv-vim +whitelist_externals = cp + find +recreate = True +commands = {[testenv]commands} + cp -v nfv/nfv-tests/nfv_unit_tests/test_data/nfv_vim_db_18.03_GA {envdir}/ + nosetests --exe -w nfv/nfv-tests/nfv_unit_tests/tests/ '{posargs}' +