Create tox.ini file.

Configure with minimal requirements for running -
  pep8 - flake8 verifications
  py27/py35 - unittests

Change-Id: If09bab1f0a8501afddd720cf9ea9335867072e1d
This commit is contained in:
Federico Ressi 2018-08-23 08:01:39 +02:00
parent dce03ca6ea
commit 0377537dc0
7 changed files with 85 additions and 3 deletions

11
.gitignore vendored
View File

@ -2,15 +2,20 @@
*.egg *.egg
*.egg-info *.egg-info
*.pyc *.pyc
# Hidden files
.eggs
.stestr
.test .test
.stestr*
etc
.testrepository .testrepository
.tox .tox
.venv .venv
__pycache__
AUTHORS AUTHORS
build/* build/*
ChangeLog ChangeLog
doc/build/* doc/build/*
zuul/versioninfo
dist/ dist/
etc/
zuul/versioninfo

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=${OS_TEST_PATH:-./tobiko}
top_dir=./

6
pep8-requirements.txt Normal file
View File

@ -0,0 +1,6 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
flake8==2.5.5 # MIT
flake8-import-order==0.12 # LGPLv3

1
test-requirements.txt Normal file
View File

@ -0,0 +1 @@
mock >= 2.0 # BSD

View File

@ -11,7 +11,9 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import os import os
from tempest import config from tempest import config
from tempest.test_discover import plugins from tempest.test_discover import plugins

View File

@ -12,8 +12,10 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import os import os
import subprocess import subprocess
from tempest.common.utils import net_utils from tempest.common.utils import net_utils
from tempest.lib.common.utils import test_utils from tempest.lib.common.utils import test_utils

63
tox.ini Normal file
View File

@ -0,0 +1,63 @@
[tox]
minversion = 2.0
envlist = pep8,py35,py27
[testenv]
# usedevelop = True
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}
PYTHONWARNINGS=default::DeprecationWarning,{env:PYTHONWARNINGS:}
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
passenv =
commands =
stestr run {posargs}
deps =
-r{toxinidir}/test-requirements.txt
[testenv:venv]
basepython = python3
deps =
commands =
{posargs}
[testenv:pep8]
basepython = python3
deps =
-r{toxinidir}/pep8-requirements.txt
commands =
flake8
[flake8]
# E125 continuation line does not distinguish itself from next logical line
# E126 continuation line over-indented for hanging indent
# E128 continuation line under-indented for visual indent
# E129 visually indented line with same indent as next logical line
# E265 block comment should start with '# '
# H404 multi line docstring should start with a summary
# H405 multi line docstring summary not separated with an empty line
# N530 direct neutron imports not allowed
ignore = E125,E126,E128,E129,E265,H404,H405,N530
# H106: Don't put vim configuration in source files
# H203: Use assertIs(Not)None to check for None
# H904: Delay string interpolations at logging calls
enable-extensions = H106,H203,H904
show-source = true
exclude = ./.*,build,dist,doc,*egg*,releasenotes
import-order-style = pep8