nfv/nfv/nfv-tests/nfv_unit_tests/tox.ini

101 lines
2.9 KiB
INI
Executable File

#
# Copyright (c) 2015-2016 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[nfv]
nfv_base_dir = ../..
nfv_client_dir = ../../nfv-client
nfv_common_dir = ../../nfv-common
nfv_plugins_dir = ../../nfv-plugins
nfv_vim_dir = ../../nfv-vim
stx_fault_dir = ../../../../stx-fault
nfv_client_src_dir = {[nfv]nfv_client_dir}/nfv_client
nfv_common_src_dir = {[nfv]nfv_common_dir}/nfv_common
nfv_plugins_src_dir = {[nfv]nfv_plugins_dir}/nfv_plugins
nfv_vim_src_dir = {[nfv]nfv_vim_dir}/nfv_vim
deps = {[nfv]nfv_client_dir}
{[nfv]nfv_common_dir}
{[nfv]nfv_plugins_dir}
{[nfv]nfv_vim_dir}
{[nfv]stx_fault_dir}/fm-api
iso8601
keyring
kombu
kubernetes
passlib
pecan
pyparsing
PyYAML
sqlalchemy
stevedore
wsme
[nosetests]
verbosity=2
[tox]
toxworkdir = /tmp/{env:USER}_nfvtox
envlist = pep8,py27-sqlite
[testenv]
recreate = True
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
[testenv:pep8]
deps = flake8
commands = flake8 --max-line-length 84 {[nfv]nfv_client_dir}
flake8 --max-line-length 84 {[nfv]nfv_common_dir}
flake8 --max-line-length 84 {[nfv]nfv_plugins_dir}
flake8 --max-line-length 84 {[nfv]nfv_vim_dir}
[testenv:lint]
deps = {[nfv]deps}
pylint
basepython = python2.7
commands = pylint {[nfv]nfv_client_src_dir} \
{[nfv]nfv_common_src_dir} \
{[nfv]nfv_plugins_src_dir} \
{[nfv]nfv_vim_src_dir} \
--rcfile=./pylint.rc
[bandit]
# These are the bandit codes that are failing for stx-nfv
# B104: hardcoded_bind_all_interfaces
# B108: Probable insecure usage of temp file/directory
# B110: Try, Except, Pass detected.
# B310: Audit url open for permitted schemes
# B506: Test for use of yaml load
skips = B104,B108,B110,B310,B506
exclude = nfv-docs,nfv-tests,nfv-debug-tools,unit_test
[testenv:bandit]
deps = {[nfv]deps}
bandit
basepython = python2.7
commands = bandit --ini tox.ini -f txt -r {[nfv]nfv_base_dir}
[testenv:py27-sqlite]
basepython = py27-sqlite: python2.7
deps = {[nfv]deps}
mock
nose
coverage
setenv = PYTHONDONTWRITEBYTECODE=True
#commands = nosetests --pdb --exe -w tests/
commands = cp -v ./test_data/nfv_vim_db_18.03_GA {envdir}/
{envbindir}/nosetests --exe -w tests/ '{posargs}'
# Use the following for code coverage
# {envbindir}/nosetests --exe --cover-erase --cover-branches \
# --cover-package=nfv_common,nfv_vim --with-coverage -w tests/
whitelist_externals = cp