Browse Source

Create tox.ini file.

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

Change-Id: If09bab1f0a8501afddd720cf9ea9335867072e1d
changes/92/595492/1
Federico Ressi 3 years ago
parent
commit
0377537dc0
  1. 11
      .gitignore
  2. 3
      .stestr.conf
  3. 6
      pep8-requirements.txt
  4. 1
      test-requirements.txt
  5. 2
      tobiko/plugin.py
  6. 2
      tobiko/tests/scenario/base.py
  7. 63
      tox.ini

11
.gitignore

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

3
.stestr.conf

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

6
pep8-requirements.txt

@ -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

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

2
tobiko/plugin.py

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

2
tobiko/tests/scenario/base.py

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

63
tox.ini

@ -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
Loading…
Cancel
Save