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
This commit is contained in:
Jesse Pretorius 2016-09-27 17:18:43 +01:00
parent 736f66bfed
commit 31773b0736

37
tox.ini
View File

@ -22,11 +22,9 @@ passenv =
NO_PROXY NO_PROXY
whitelist_externals = whitelist_externals =
bash bash
git
rm
wget
setenv = setenv =
VIRTUAL_ENV={envdir} VIRTUAL_ENV={envdir}
WORKING_DIR={toxinidir}
[testenv:docs] [testenv:docs]
@ -52,17 +50,17 @@ commands =
{posargs} {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] [testenv:pep8]
commands = commands =
# Run hacking/flake8 check for all python files {[testenv:tests_clone]commands}
bash -c "grep --recursive --binary-files=without-match \ bash -c "{toxinidir}/tests/common/test-pep8.sh"
--files-with-match '^.!.*python$' \
--exclude-dir .eggs \
--exclude-dir .git \
--exclude-dir .tox \
--exclude-dir *.egg-info \
--exclude-dir doc \
{toxinidir} | xargs flake8 --verbose"
[flake8] [flake8]
@ -75,19 +73,8 @@ ignore=F403,H303
[testenv:bashate] [testenv:bashate]
commands = commands =
# Run bashate check for all bash scripts {[testenv:tests_clone]commands}
# Ignores the following rules: bash -c "{toxinidir}/tests/common/test-bashate.sh"
# 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:linters] [testenv:linters]