
Running tox is giving a warning because the tox.ini is using "find", but the find command is not whitelisted. Change-Id: I38ece01f6135ebb38a94b9d835e2708a02b35805 Closes-bug: #1835386 Signed-off-by: junboli <junbo85.li@gmail.com>
156 lines
4.6 KiB
INI
156 lines
4.6 KiB
INI
#
|
|
# Copyright (c) 2019 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,flake8,py27,py36,pylint,cover
|
|
minversion = 2.3
|
|
skipsdist = True
|
|
|
|
[testenv]
|
|
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
|
|
-e{[testenv]cgcs_patch_dir}
|
|
-e{[testenv]patch_alarm_dir}
|
|
-e{[testenv]tsconfig_dir}
|
|
whitelist_externals = find
|
|
|
|
[testenv:linters]
|
|
basepython = python3
|
|
whitelist_externals = bash
|
|
commands =
|
|
bash -c "find {toxinidir} \
|
|
-not \( -type d -name .?\* -prune \) \
|
|
-type f \
|
|
-not -name \*~ \
|
|
-not -name \*.md \
|
|
\( \
|
|
-name \*.sh \
|
|
-or -not -wholename \*/devstack/files/\* \
|
|
-wholename \*/devstack/\* \
|
|
\) \
|
|
-print0 | xargs -0 bashate -v -e 'E*' -iE006"
|
|
bash -c "find {toxinidir} \
|
|
\( -name .tox -prune \) \
|
|
-o -type f -name '*.yaml' \
|
|
-print0 | xargs -0 yamllint"
|
|
|
|
[flake8]
|
|
basepython = python3
|
|
whitelist_externals = cp
|
|
find
|
|
tox
|
|
recreate = True
|
|
commands = {[testenv]commands}
|
|
tox -c tsconfig/tsconfig -e flake8
|
|
tox -c cgcs-patch/cgcs-patch -e flake8
|
|
tox -c patch-alarm/patch-alarm -e flake8
|
|
|
|
[testenv:venv]
|
|
basepython = python3
|
|
commands = {posargs}
|
|
|
|
[nosetests]
|
|
verbosity=2
|
|
|
|
[testenv:py27]
|
|
basepython = python2.7
|
|
deps = {[testenv]deps}
|
|
whitelist_externals = cp
|
|
find
|
|
tox
|
|
recreate = True
|
|
commands = {[testenv]commands}
|
|
tox -c tsconfig/tsconfig -e py27
|
|
tox -c cgcs-patch/cgcs-patch -e py27
|
|
tox -c patch-alarm/patch-alarm -e py27
|
|
|
|
[testenv:py36]
|
|
basepython = python3
|
|
deps = {[testenv]deps}
|
|
whitelist_externals = cp
|
|
find
|
|
tox
|
|
recreate = True
|
|
commands = {[testenv]commands}
|
|
tox -c tsconfig/tsconfig -e py36
|
|
tox -c cgcs-patch/cgcs-patch -e py36
|
|
tox -c patch-alarm/patch-alarm -e py36
|
|
|
|
[testenv:pylint]
|
|
basepython = python2.7
|
|
deps = {[testenv]deps}
|
|
whitelist_externals = cp
|
|
find
|
|
tox
|
|
recreate = True
|
|
commands = {[testenv]commands}
|
|
tox -c tsconfig/tsconfig -e pylint
|
|
tox -c cgcs-patch/cgcs-patch -e pylint
|
|
tox -c patch-alarm/patch-alarm -e pylint
|
|
|
|
[testenv:cover]
|
|
basepython = python2.7
|
|
deps = {[testenv]deps}
|
|
whitelist_externals = cp
|
|
find
|
|
tox
|
|
recreate = True
|
|
commands = {[testenv]commands}
|
|
tox -c tsconfig/tsconfig -e cover
|
|
tox -c cgcs-patch/cgcs-patch -e cover
|
|
tox -c patch-alarm/patch-alarm -e cover
|
|
|
|
[testenv:docs]
|
|
basepython = python3
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
|
commands =
|
|
rm -rf doc/build
|
|
sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html
|
|
whitelist_externals = rm
|
|
|
|
[testenv:releasenotes]
|
|
basepython = python3
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
|
commands =
|
|
rm -rf releasenotes/build
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
|
whitelist_externals =
|
|
rm
|
|
reno
|
|
|
|
[testenv:newnote]
|
|
basepython = python3
|
|
# Re-use the releasenotes venv
|
|
envdir = {toxworkdir}/releasenotes
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
|
commands = reno new {posargs}
|
|
|
|
[testenv:api-ref]
|
|
basepython = python3
|
|
deps =
|
|
-r{toxinidir}/doc/requirements.txt
|
|
commands =
|
|
rm -rf api-ref/build
|
|
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
|
|
whitelist_externals = rm
|