29126ba9f8
Migration of Openstack Project is held in *.rst files and build with Sphinx. Following change provides: * technical documention * api guide * api ref * releasenotes Note: For now, generating codebase documentation is disabled. It caused gate failures because of, yet unnown, reasons. In order to pull this foundation, this part is skipped. Extra: * provided venvs descriptions to let user know what is the scope Story: 2001058 Task: 4665 Change-Id: Ieb2b58e165de1617748d97d997af368bd91d5c0e
146 lines
4.0 KiB
INI
146 lines
4.0 KiB
INI
[tox]
|
|
envlist = py{27,35},pep8,cover
|
|
minversion = 2.1
|
|
skipsdist = True
|
|
|
|
[testenv]
|
|
usedevelop = True
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
OS_TEST_PATH=monasca_log_api/tests
|
|
CLIENT_NAME=monasca-log-api
|
|
passenv = http_proxy
|
|
HTTP_PROXY
|
|
https_proxy
|
|
HTTPS_PROXY
|
|
no_proxy
|
|
NO_PROXY
|
|
whitelist_externals = bash
|
|
find
|
|
rm
|
|
install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
commands =
|
|
find ./ -type f -name '*.pyc' -delete
|
|
rm -Rf .testrepository/times.dbm
|
|
|
|
[testenv:py27]
|
|
description = Runs unit test using Python2.7
|
|
basepython = python2.7
|
|
commands =
|
|
{[testenv]commands}
|
|
ostestr {posargs}
|
|
|
|
[testenv:py35]
|
|
description = Runs unit test using Python3.5
|
|
basepython = python3.5
|
|
commands =
|
|
{[testenv]commands}
|
|
ostestr {posargs}
|
|
|
|
[testenv:cover]
|
|
description = Calculates code coverage
|
|
basepython = python2.7
|
|
commands =
|
|
{[testenv]commands}
|
|
coverage erase
|
|
python setup.py test --coverage --testr-args='{posargs}' --coverage-package-name=monasca_log_api
|
|
coverage report
|
|
|
|
[testenv:debug]
|
|
description = Allows to run unit-test with debug mode enabled
|
|
commands =
|
|
{[testenv]commands}
|
|
oslo_debug_helper -t {toxinidir}/monasca_log_api/tests {posargs}
|
|
|
|
[testenv:bashate]
|
|
description = Validates (pep8-like) devstack plugins
|
|
deps = bashate
|
|
whitelist_externals = bashate
|
|
commands =
|
|
# Ignore too long lines error E006 from bashate and treat
|
|
# E005, E042 as errors.
|
|
bashate -v -iE006 -eE005,E042 {toxinidir}/devstack/plugin.sh
|
|
|
|
[testenv:bandit]
|
|
commands =
|
|
# FIXME(dmllr); B101 needs to be fixed first
|
|
bandit -r monasca_log_api -n5 -s B101 -x monasca_log_api/tests
|
|
|
|
[testenv:flake8]
|
|
commands =
|
|
flake8 monasca_log_api
|
|
|
|
[testenv:pep8]
|
|
description = Runs set of linters against codebase (flake8, bandit, bashate, checkniceness)
|
|
deps =
|
|
{[testenv]deps}
|
|
{[testenv:bashate]deps}
|
|
commands =
|
|
{[testenv:flake8]commands}
|
|
{[testenv:bandit]commands}
|
|
{[testenv:bashate]commands}
|
|
{[testenv:checkniceness]commands}
|
|
|
|
[testenv:docs]
|
|
description = Builds api-ref, api-guide, releasenotes and devdocs
|
|
commands =
|
|
{[testenv:devdocs]commands}
|
|
{[testenv:api-guide]commands}
|
|
{[testenv:api-ref]commands}
|
|
{[testenv:releasenotes]commands}
|
|
|
|
[testenv:api-guide]
|
|
description = Called from CI scripts to test and publish the API Guide
|
|
commands =
|
|
rm -rf api-guide/build
|
|
{[testenv:checkjson]commands}
|
|
sphinx-build -W -b html -d api-guide/build/doctrees api-guide/source api-guide/build/html
|
|
|
|
[testenv:api-ref]
|
|
description = Called from CI scripts to test and publish the API Ref
|
|
commands =
|
|
rm -rf api-ref/build
|
|
{[testenv:checkjson]commands}
|
|
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
|
|
|
|
[testenv:releasenotes]
|
|
description = Called from CI script to test and publish the Release Notes
|
|
commands =
|
|
rm -rf releasenotes/build
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
|
|
|
[testenv:devdocs]
|
|
description = Builds developer documentation
|
|
commands =
|
|
rm -rf doc/build
|
|
{[testenv:checkjson]commands}
|
|
python setup.py build_sphinx
|
|
|
|
[testenv:checkniceness]
|
|
description = Validates (pep-like) documenation
|
|
commands =
|
|
doc8 --file-encoding utf-8 {toxinidir}/doc
|
|
doc8 --file-encoding utf-8 {toxinidir}/api-ref
|
|
doc8 --file-encoding utf-8 {toxinidir}/api-guide
|
|
doc8 --file-encoding utf-8 {toxinidir}/releasenotes
|
|
|
|
[testenv:checkjson]
|
|
description = Validates all json samples inside doc folder
|
|
deps =
|
|
whitelist_externals =
|
|
bash
|
|
python
|
|
commands =
|
|
bash -c "! find doc/ -type f -name *.json | xargs grep -U -n $'\r'"
|
|
bash -c '! find doc/ -type f -name *.json | xargs -t -n1 python -m json.tool 2>&1 > /dev/null | grep -B1 -v ^python'
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[flake8]
|
|
exclude = .git,.tox,dist,doc,api-ref,api-guide,releasenotes,documentation,*.egg,build
|
|
show-source = True
|
|
enable-extensions = H203,H106
|
|
|
|
[hacking]
|