update/tox.ini

109 lines
2.9 KiB
INI

#
# Copyright (c) 2018 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.
[tox]
envlist = linters,pep8,py27,py35,pylint
minversion = 2.3
skipsdist = True
[testenv]
basepython = python3
install_command = pip install -U {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=60
PYTHONDONTWRITEBYTECODE=True
cgcs_patch_dir = {toxinidir}/cgcs-patch/cgcs-patch
cgcs_patch_src_dir = {[testenv]cgcs_patch_dir}/cgcs_patch
patch_alarm_dir = {toxinidir}/patch-alarm/patch-alarm
patch_alarm_src_dir = {[testenv]patch_alarm_dir}/patch_alarm
tsconfig_dir = {toxinidir}/tsconfig/tsconfig
tsconfig_src_dir = {[testenv]tsconfig_dir}/tsconfig
commands = find {toxinidir} -type f -not -path '{toxinidir}/.tox/*' -not -path '*/__pycache__/*' -name '*.py[c|o]' -delete
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
{[testenv]cgcs_patch_dir}
{[testenv]patch_alarm_dir}
{[testenv]tsconfig_dir}
[testenv:linters]
whitelist_externals = bash
commands =
bash -c "find {toxinidir} \
\( -name .tox -prune \) \
-o -type f -name '*.yaml' \
-print0 | xargs --no-run-if-empty -0 yamllint"
bash -c "find {toxinidir} \
-not \( -type d -name .?\* -prune \) \
-type f \
-not -name \*~ \
-not -name \*.md \
-name \*.sh \
-print0 | xargs --no-run-if-empty -0 bashate -v -e 'E*' -iE006"
[pep8]
# Ignoring these warnings
# E501 line too long
ignore = E501
[testenv:pep8]
usedevelop = False
skip_install = True
deps =
pep8
commands =
pep8
[testenv:venv]
commands = {posargs}
[nosetests]
verbosity=2
[testenv:py27]
basepython = python2.7
deps = {[testenv]deps}
whitelist_externals = cp
find
recreate = True
commands = {[testenv]commands}
[testenv:py35]
basepython = python3
deps = {[testenv]deps}
whitelist_externals = cp
find
recreate = True
commands = {[testenv]commands}
[testenv:pylint]
deps = {[testenv]deps}
pylint
-e{toxinidir}/../stx-config/sysinv/sysinv/sysinv
-e{toxinidir}/../stx-fault/fm-api
pyCrypto
daemon
keystoneauth1
keystonemiddleware
netaddr
oslo_config
pecan
requests
requests_toolbelt
rpm
basepython = python2.7
commands = pylint {[testenv]cgcs_patch_src_dir} \
{[testenv]patch_alarm_src_dir} \
{[testenv]tsconfig_src_dir} \
--rcfile=./pylint.rc