Disabling python27 unit tests and enabling zuul jobs

Change-Id: I94bec5d6818cbf5d2e58589efdba7799cb6e02e7
This commit is contained in:
Anand Shanmugam 2020-05-27 06:20:56 +00:00
parent 0bc7472f23
commit ace2c424f1
3 changed files with 42 additions and 8 deletions

7
.zuul.yaml Normal file
View File

@ -0,0 +1,7 @@
- project:
check:
jobs:
- openstack-tox-pep8
gate:
jobs:
- openstack-tox-pep8

20
tools/flake8wrap.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/sh
#
# A simple wrapper around flake8 which makes it possible
# to ask it to only verify files changed in the current
# git HEAD patch.
#
# Intended to be invoked via tox:
#
# tox -epep8 -- -HEAD
#
if test "x$1" = "x-HEAD" ; then
shift
files=$(git diff --name-only HEAD~1 | tr '\n' ' ')
echo "Running flake8 on ${files}"
diff -u --from-file /dev/null ${files} | flake8 --diff "$@"
else
echo "Running flake8 on all files"
exec flake8 "$@"
fi

23
tox.ini
View File

@ -1,22 +1,30 @@
[tox]
minversion = 2.0
envlist = py36,py27,pep8
envlist = pep8
skipsdist = True
[testenv]
basepython = python3
usedevelop = True
install_command = pip install -U {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = python setup.py test --slowest --testr-args='{posargs}'
PYTHONWARNINGS=default::DeprecationWarning
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
passenv = TEMPEST_* OS_TEST_*
commands =
find . -type f -name "*.py[c|o]" -delete
stestr run {posargs}
[testenv:pep8]
commands = flake8
commands =
bash tools/flake8wrap.sh {posargs}
[testenv:venv]
basepython = python3
commands = {posargs}
[testenv:genconfig]
@ -42,7 +50,6 @@ commands = bandit -c bandit.yaml -r cloudpulse -p gate
[flake8]
# E123, E125 skipped as they are invalid PEP-8.
show-source = True
ignore = E123,E125
builtins = _