From 31773b0736f0930db7e188f18dccdf27d6831703 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Tue, 27 Sep 2016 17:18:43 +0100 Subject: [PATCH] Use centralised test scripts This patch consumes the test scripts implemented by https://review.openstack.org/375061 to ensure that the tests and test preparation is consistent and more maintainable. Change-Id: Ic24df14a7011dac134059cf32a3952c948af60dc --- tox.ini | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/tox.ini b/tox.ini index 993a0c7e..f3d71c2f 100644 --- a/tox.ini +++ b/tox.ini @@ -22,11 +22,9 @@ passenv = NO_PROXY whitelist_externals = bash - git - rm - wget setenv = VIRTUAL_ENV={envdir} + WORKING_DIR={toxinidir} [testenv:docs] @@ -52,17 +50,17 @@ commands = {posargs} +[testenv:tests_clone] +commands = + bash -c "if [ ! -d "{toxinidir}/tests/common" ]; then \ + git clone https://git.openstack.org/openstack/openstack-ansible-tests {toxinidir}/tests/common; \ + fi" + + [testenv:pep8] commands = - # Run hacking/flake8 check for all python files - bash -c "grep --recursive --binary-files=without-match \ - --files-with-match '^.!.*python$' \ - --exclude-dir .eggs \ - --exclude-dir .git \ - --exclude-dir .tox \ - --exclude-dir *.egg-info \ - --exclude-dir doc \ - {toxinidir} | xargs flake8 --verbose" + {[testenv:tests_clone]commands} + bash -c "{toxinidir}/tests/common/test-pep8.sh" [flake8] @@ -75,19 +73,8 @@ ignore=F403,H303 [testenv:bashate] commands = - # Run bashate check for all bash scripts - # Ignores the following rules: - # E003: Indent not multiple of 4 (we prefer to use multiples of 2) - # E006: Line longer than 79 columns (as many scripts use jinja - # templating, this is very difficult) - # E040: Syntax error determined using `bash -n` (as many scripts - # use jinja templating, this will often fail and the syntax - # error will be discovered in execution anyway) - bash -c "grep --recursive --binary-files=without-match \ - --files-with-match '^.!.*\(ba\)\?sh$' \ - --exclude-dir .tox \ - --exclude-dir .git \ - {toxinidir} | xargs bashate --error . --verbose --ignore=E003,E006,E040" + {[testenv:tests_clone]commands} + bash -c "{toxinidir}/tests/common/test-bashate.sh" [testenv:linters]