Files
bf5031430acd4c88c224c435832283befceb66f4
nova /tox.ini

226 lines
8.6 KiB
INI
Raw Normal View History

[testenv]
whitelist_externals = bash
setenv = VIRTUAL_ENV={envdir}
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=160
commands =
{[testenv]commands}
[testenv:py35]
commands =
{[testenv]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'
# This is a subset of the full pep8 check which
# only runs flake8 on the changes made since
# HEAD-1. For a full flake8 run including checking
# docs, just use pep8.
basepython = python2.7
commands =
bash tools/flake8wrap.sh -HEAD
# python 3.x
# same process when running concurently. The following ensures that gabbi tests
# coming from the same YAML file are all in the same process. This is important
# because each YAML file represents an ordered sequence of HTTP requests. Note
# that tests which do not match this regex will not be grouped in any
# special way. See the following for more details.
# http://stestr.readthedocs.io/en/latest/MANUAL.html#grouping-tests
# https://gabbi.readthedocs.io/en/latest/#purpose
stestr --test-path=./nova/tests/functional --group-regex=nova\.tests\.functional\.api\.openstack\.placement\.test_placement_api(?:\.|_)([^_]+) run '{posargs}'
# with python 3.5
[testenv:functional-py35]
basepython = python3.5
usedevelop = True
# same process when running concurently. The following ensures that gabbi tests
# coming from the same YAML file are all in the same process. This is important
# because each YAML file represents an ordered sequence of HTTP requests. Note
# that tests which do not match this regex will not be grouped in any
# special way. See the following for more details.
# http://stestr.readthedocs.io/en/latest/MANUAL.html#grouping-tests
# https://gabbi.readthedocs.io/en/latest/#purpose
stestr --test-path=./nova/tests/functional --group-regex=nova\.tests\.functional\.api\.openstack\.placement\.test_placement_api(?:\.|_)([^_]+) run '{posargs}'
usedevelop = True
GENERATE_SAMPLES=True
PYTHONHASHSEED=0
commands = oslopolicy-sample-generator --config-file=etc/nova/nova-policy-generator.conf
# Also do not run test_coverage_ext tests while gathering coverage as those
# tests conflict with coverage.
PYTHON=coverage run --source nova --parallel-mode
coverage erase
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
commands =
find . -type f -name "*.pyc" -delete
oslo_debug_helper {posargs}
# with python 3.x
basepython = python2.7
Structure for simply managing placement-api-ref This consists of a duplicate of the [nova-]api-ref setup and conf.py along with tooling to fail the tox -edocs target when a route that is defined in nova.api.openstack.placement.handler.ROUTE_DECLARATIONS is not present in placement-api-ref/source/index.rst. tools/placement_api_docs.py will report which routes are missing. Though completely gameable (as demonstrated in the current lame index.rst) it's better than nothing and provides some useful structuring on what to do next. It's also the case that the 'docs' target in tox is not part of gating. The response for GET / is in place with the necessary parameters.yaml for it to be correctly described. The 'get-root.json' file provides the JSON of the expected response. The expectation is that later commits will add information for other urls and their JSON files will be named method-path-separated-by-dash.json with a request/response qualifier as necessary. Followup patches will add other routes. A new parameters.yaml is used instead of reusing the one from api-ref as there isn't a lot of expected overlap and having a separate file will ease eventual extraction. Running tox -eplacement-api-ref will generate the docs for review, with output in placement-api-ref/build/html/index.html. This will be hooked up with CI to deploy the generated docs, eventually. Change-Id: Ifb4d91d39db0e49b55952e37cdfc9f63dcd37aa3
2016年12月09日 21:47:25 +00:00
rm -rf doc/source/api doc/build api-guide/build api-ref/build placement-api-ref/build
bash -c "! find doc/ -type f -name *.json | xargs grep -U -n $'\r'"
Structure for simply managing placement-api-ref This consists of a duplicate of the [nova-]api-ref setup and conf.py along with tooling to fail the tox -edocs target when a route that is defined in nova.api.openstack.placement.handler.ROUTE_DECLARATIONS is not present in placement-api-ref/source/index.rst. tools/placement_api_docs.py will report which routes are missing. Though completely gameable (as demonstrated in the current lame index.rst) it's better than nothing and provides some useful structuring on what to do next. It's also the case that the 'docs' target in tox is not part of gating. The response for GET / is in place with the necessary parameters.yaml for it to be correctly described. The 'get-root.json' file provides the JSON of the expected response. The expectation is that later commits will add information for other urls and their JSON files will be named method-path-separated-by-dash.json with a request/response qualifier as necessary. Followup patches will add other routes. A new parameters.yaml is used instead of reusing the one from api-ref as there isn't a lot of expected overlap and having a separate file will ease eventual extraction. Running tox -eplacement-api-ref will generate the docs for review, with output in placement-api-ref/build/html/index.html. This will be hooked up with CI to deploy the generated docs, eventually. Change-Id: Ifb4d91d39db0e49b55952e37cdfc9f63dcd37aa3
2016年12月09日 21:47:25 +00:00
sphinx-build -W -b html placement-api-ref/source placement-api-ref/build/html
[testenv:api-guide]
# This environment is called from CI scripts to test and publish
# the API Guide to developer.openstack.org.
commands =
# This environment is called from CI scripts to test and publish
# the API Ref to developer.openstack.org.
commands =
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
# This environment is called from CI scripts to test and publish
# the Placement API Ref to developer.openstack.org.
commands =
# Check that all placement api routes are in the documentation
sphinx-build -W -b html -d placement-api-ref/build/doctrees placement-api-ref/source placement-api-ref/build/html
# project. Please do not remove.
commands = bandit -r nova -x tests -n 5 -ll
# https://github.com/jcrocholl/pep8/issues/126. It's just wrong.
#
# Most of the whitespace related rules (E12* and E131) are excluded
# because while they are often useful guidelines, strict adherence to
# them ends up causing some really odd code formatting and forced
# extra line breaks. Updating code to enforce these will be a hard sell.
#
# H405 is another one that is good as a guideline, but sometimes
# multiline doc strings just don't have a natural summary
# line. Rejecting code for this reason is wrong.
#
# to 25 and run 'tox -epep8'.
[hacking]
local-check-factory = nova.hacking.checks.factory
[testenv:pip-missing-reqs]
# do not install test-requirements as that will pollute the virtualenv for
# determining missing packages
# this also means that pip-missing-reqs must be installed separately, outside
# of the requirements.txt files
[testenv:bindep]
# Do not install any requirements. We want this to be fast and work even if
# system dependencies are missing, since it's used to tell you what system
# dependencies are missing! This also means that bindep must be installed
# separately, outside of the requirements files, and develop mode disabled
# explicitly to avoid unnecessarily installing the checked-out repo too (this
# further relies on "tox.skipsdist = True" above).
deps = bindep
commands = bindep test
usedevelop = False