diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..0ae6c2c --- /dev/null +++ b/.gitreview @@ -0,0 +1,4 @@ +[gerrit] +host=review.openstack.org +port=29418 +project=openstack/stx-distcloud-client.git diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 0000000..160d0be --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,10 @@ +--- +- project: + check: + jobs: + - openstack-tox-linters + - openstack-tox-pep8: + voting: false + gate: + jobs: + - openstack-tox-linters diff --git a/test-requirements.txt b/test-requirements.txt index 017d476..f2d1a07 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -11,3 +11,6 @@ mock>=2.0 # BSD nose # LGPL tempest>=14.0.0 # Apache-2.0 testtools>=1.4.0 # MIT + +PyYAML>=3.1.0 +yamllint>=0.5.2 diff --git a/tox.ini b/tox.ini index 49f1d5f..41a1b07 100644 --- a/tox.ini +++ b/tox.ini @@ -1,19 +1,22 @@ [tox] -minversion = 2.0 +minversion = 2.3 envlist = py27,pep8 -# Tox does not work if the path to the workdir is too long, so move it to /tmp -toxworkdir = /tmp/{env:USER}_distributedcloud-client skipsdist = True [testenv] -usedevelop = True +basepython = python3 install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} setenv = VIRTUAL_ENV={envdir} - DISCOVER_DIRECTORY=dcmanagerclient/tests -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt -commands = python setup.py testr --slowest --testr-args='{posargs}' + OS_STDOUT_CAPTURE=1 + OS_STDERR_CAPTURE=1 + OS_TEST_TIMEOUT=60 +# DISCOVER_DIRECTORY=dcmanagerclient/tests + +deps = -r{toxinidir}/test-requirements.txt +#deps = -r{toxinidir}/requirements.txt +# -r{toxinidir}/test-requirements.txt +#commands = python setup.py testr --slowest --testr-args='{posargs}' [testenv:pep8] commands = flake8 {posargs} @@ -33,3 +36,14 @@ show-source = True ignore = E123,E125 builtins = _ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*openstack/common*,*egg,build + +[testenv:linters] +# bashate ignore: +# E006 - accept long lines +# E040 - false positive on |& syntax (new in bash 4) +whitelist_externals = bash +commands = + bash -c "find {toxinidir} \ + \( -name .tox -prune \) \ + -o -type f -name '*.yaml' \ + -print0 | xargs -0 yamllint"