Inspect and correct tox.ini, .stestr.conf and setup.cfg

Begin the process of getting placement tests running, by getting the
test harness opertional.

Before we can expect the tests to be able to run the configuration for
the placement package and its test harness needs to be adjusted for
"nova" -> "placement". These changes are made by inspection and based
on previous iterations of doing these kinds of cleanups, it won't be
until later in this stack of change that actually passing tests will
show up. However, the logs for attempted tests runs should be getting
a little bit further than the parent.

setup.cfg changes quite a bit because there are many things in it that
are not relevant. placement (thus far) really only has one entry point.
As noted, by a TODO, a placement-manage and placement-status will be
desired in the near future.

Change-Id: Iaa385c6e8653a9646a21bb65203deaa05ec43217
This commit is contained in:
Chris Dent 2018-09-03 12:12:23 +01:00 committed by Eric Fried
parent 3100eb64ae
commit eaeeea1cfe
3 changed files with 27 additions and 115 deletions

View File

@ -1,3 +1,3 @@
[DEFAULT] [DEFAULT]
test_path=./nova/tests/unit test_path=./placement/tests/unit
top_dir=./ top_dir=./

View File

@ -1,11 +1,11 @@
[metadata] [metadata]
name = nova name = placement
summary = Cloud computing fabric controller summary = Resource provider inventory usage and allocation service
description-file = description-file =
README.rst README.rst
author = OpenStack author = OpenStack
author-email = openstack-dev@lists.openstack.org author-email = openstack-dev@lists.openstack.org
home-page = https://docs.openstack.org/nova/latest/ home-page = https://docs.openstack.org/placement/latest/
classifier = classifier =
Environment :: OpenStack Environment :: OpenStack
Intended Audience :: Information Technology Intended Audience :: Information Technology
@ -23,23 +23,14 @@ setup-hooks =
pbr.hooks.setup_hook pbr.hooks.setup_hook
[files] [files]
data_files =
etc/nova =
etc/nova/api-paste.ini
etc/nova/rootwrap.conf
etc/nova/rootwrap.d = etc/nova/rootwrap.d/*
packages = packages =
nova placement
[entry_points] [entry_points]
oslo.config.opts = oslo.config.opts =
nova.conf = nova.conf.opts:list_opts placement.conf = placement.conf.opts:list_opts
oslo.config.opts.defaults =
nova.conf = nova.common.config:set_middleware_defaults
oslo.policy.enforcer = oslo.policy.enforcer =
nova = nova.policy:get_enforcer
placement = placement.policy:get_enforcer placement = placement.policy:get_enforcer
oslo.policy.policies = oslo.policy.policies =
@ -47,46 +38,15 @@ oslo.policy.policies =
# returned from that entry point. If more control is desired split out each # returned from that entry point. If more control is desired split out each
# list_rules method into a separate entry point rather than using the # list_rules method into a separate entry point rather than using the
# aggregate method. # aggregate method.
nova = nova.policies:list_rules
placement = placement.policies:list_rules placement = placement.policies:list_rules
nova.compute.monitors.cpu =
virt_driver = nova.compute.monitors.cpu.virt_driver:Monitor
console_scripts = console_scripts =
nova-api = nova.cmd.api:main # TODO(cdent): We will need some kind of placement-manage and
nova-api-metadata = nova.cmd.api_metadata:main # placement-status, eventually
nova-api-os-compute = nova.cmd.api_os_compute:main # nova-manage = nova.cmd.manage:main
nova-cells = nova.cmd.cells:main # nova-status = nova.cmd.status:main
nova-compute = nova.cmd.compute:main
nova-conductor = nova.cmd.conductor:main
nova-console = nova.cmd.console:main
nova-consoleauth = nova.cmd.consoleauth:main
nova-dhcpbridge = nova.cmd.dhcpbridge:main
nova-manage = nova.cmd.manage:main
nova-network = nova.cmd.network:main
nova-novncproxy = nova.cmd.novncproxy:main
nova-policy = nova.cmd.policy:main
nova-rootwrap = oslo_rootwrap.cmd:main
nova-rootwrap-daemon = oslo_rootwrap.cmd:daemon
nova-scheduler = nova.cmd.scheduler:main
nova-serialproxy = nova.cmd.serialproxy:main
nova-spicehtml5proxy = nova.cmd.spicehtml5proxy:main
nova-status = nova.cmd.status:main
nova-xvpvncproxy = nova.cmd.xvpvncproxy:main
wsgi_scripts = wsgi_scripts =
nova-placement-api = placement.wsgi:init_application placement-api = placement.wsgi:init_application
nova-api-wsgi = compute.wsgi:init_application
nova-metadata-wsgi = nova.api.metadata.wsgi:init_application
nova.ipv6_backend =
rfc2462 = nova.ipv6.rfc2462
account_identifier = nova.ipv6.account_identifier
nova.scheduler.driver =
filter_scheduler = nova.scheduler.filter_scheduler:FilterScheduler
caching_scheduler = nova.scheduler.caching_scheduler:CachingScheduler
fake_scheduler = nova.tests.unit.scheduler.fakes:FakeScheduler
[egg_info] [egg_info]
tag_build = tag_build =
@ -94,22 +54,20 @@ tag_date = 0
tag_svn_revision = 0 tag_svn_revision = 0
[compile_catalog] [compile_catalog]
directory = nova/locale # TODO(cdent): Create translation infrastructure.
domain = nova # See: https://docs.openstack.org/oslo.i18n/latest/user/usage.html
directory = placement/locale
domain = placement
[update_catalog] [update_catalog]
domain = nova domain = placement
output_dir = nova/locale output_dir = placement/locale
input_file = nova/locale/nova.pot input_file = placement/locale/placement.pot
[extract_messages] [extract_messages]
keywords = _ gettext ngettext l_ lazy_gettext keywords = _ gettext ngettext l_ lazy_gettext
mapping_file = babel.cfg mapping_file = babel.cfg
output_file = nova/locale/nova.pot output_file = placement/locale/placement.pot
[wheel] [wheel]
universal = 1 universal = 1
[extras]
osprofiler =
osprofiler>=1.4.0 # Apache-2.0

62
tox.ini
View File

@ -35,7 +35,6 @@ basepython = python2.7
commands = commands =
{[testenv]commands} {[testenv]commands}
stestr run {posargs} stestr run {posargs}
env TEST_OSPROFILER=1 stestr run --combine --no-discover 'nova.tests.unit.test_profiler'
stestr slowest stestr slowest
[testenv:py35] [testenv:py35]
@ -44,7 +43,6 @@ basepython = python3.5
commands = commands =
{[testenv]commands} {[testenv]commands}
stestr run {posargs} stestr run {posargs}
env TEST_OSPROFILER=1 stestr run --combine --no-discover 'nova.tests.unit.test_profiler'
[testenv:py36] [testenv:py36]
# TODO(efried): Remove this once https://github.com/tox-dev/tox/issues/425 is fixed. # TODO(efried): Remove this once https://github.com/tox-dev/tox/issues/425 is fixed.
@ -58,10 +56,6 @@ description =
envdir = {toxworkdir}/shared envdir = {toxworkdir}/shared
commands = commands =
bash tools/flake8wrap.sh {posargs} bash tools/flake8wrap.sh {posargs}
# Check that all JSON files don't have \r\n in line.
bash -c "! find doc/ -type f -name *.json | xargs grep -U -n $'\r'"
# Check that all included JSON files are valid JSON
bash -c '! find doc/ -type f -name *.json | xargs -t -n1 python -m json.tool 2>&1 > /dev/null | grep -B1 -v ^python'
[testenv:fast8] [testenv:fast8]
description = description =
@ -86,7 +80,7 @@ commands =
# special way. See the following for more details. # special way. See the following for more details.
# http://stestr.readthedocs.io/en/latest/MANUAL.html#grouping-tests # http://stestr.readthedocs.io/en/latest/MANUAL.html#grouping-tests
# https://gabbi.readthedocs.io/en/latest/#purpose # 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} stestr --test-path=./placement/tests/functional --group_regex=placement\.tests\.functional\.test_placement_api(?:\.|_)([^_]+) run {posargs}
stestr slowest stestr slowest
# TODO(gcb) Merge this into [testenv:functional] when functional tests are gating # TODO(gcb) Merge this into [testenv:functional] when functional tests are gating
@ -105,31 +99,16 @@ setenv = {[testenv]setenv}
commands = commands =
{[testenv:functional]commands} {[testenv:functional]commands}
[testenv:api-samples] # TODO(cdent): Config generator not yet present.
envdir = {toxworkdir}/shared
setenv =
{[testenv]setenv}
GENERATE_SAMPLES=True
PYTHONHASHSEED=0
commands =
{[testenv]commands}
stestr --test-path=./nova/tests/functional/api_sample_tests run {posargs}
stestr slowest
[testenv:genconfig] [testenv:genconfig]
envdir = {toxworkdir}/shared envdir = {toxworkdir}/shared
commands = commands =
oslo-config-generator --config-file=etc/nova/nova-config-generator.conf oslo-config-generator --config-file=etc/placement/placement-config-generator.conf
[testenv:genpolicy] [testenv:genpolicy]
envdir = {toxworkdir}/shared envdir = {toxworkdir}/shared
commands = commands =
oslopolicy-sample-generator --config-file=etc/nova/nova-policy-generator.conf oslopolicy-sample-generator --config-file=etc/placement/placement-policy-generator.conf
[testenv:genplacementpolicy]
envdir = {toxworkdir}/shared
commands =
oslopolicy-sample-generator --config-file=etc/nova/placement-policy-generator.conf
[testenv:cover] [testenv:cover]
# TODO(stephenfin): Remove the PYTHON hack below in favour of a [coverage] # TODO(stephenfin): Remove the PYTHON hack below in favour of a [coverage]
@ -139,7 +118,7 @@ commands =
envdir = {toxworkdir}/shared envdir = {toxworkdir}/shared
setenv = setenv =
{[testenv]setenv} {[testenv]setenv}
PYTHON=coverage run --source nova --parallel-mode PYTHON=coverage run --source placement --parallel-mode
commands = commands =
{[testenv]commands} {[testenv]commands}
coverage erase coverage erase
@ -169,25 +148,10 @@ description =
deps = -r{toxinidir}/doc/requirements.txt deps = -r{toxinidir}/doc/requirements.txt
commands = commands =
rm -rf doc/build rm -rf doc/build
# Check that all JSON files don't have \r\n in line.
bash -c "! find doc/ -type f -name *.json | xargs grep -U -n $'\r'"
# Check that all included JSON files are valid JSON
bash -c '! find doc/ -type f -name *.json | xargs -t -n1 python -m json.tool 2>&1 > /dev/null | grep -B1 -v ^python'
sphinx-build -W -b html doc/source doc/build/html sphinx-build -W -b html doc/source doc/build/html
# Test the redirects. This must run after the main docs build # Test the redirects. This must run after the main docs build
whereto doc/build/html/.htaccess doc/test/redirect-tests.txt whereto doc/build/html/.htaccess doc/test/redirect-tests.txt
{[testenv:api-guide]commands}
{[testenv:api-ref]commands} {[testenv:api-ref]commands}
{[testenv:placement-api-ref]commands}
[testenv:api-guide]
description =
Generate the API guide. Called from CI scripts to test and publish to developer.openstack.org.
envdir = {toxworkdir}/docs
deps = {[testenv:docs]deps}
commands =
rm -rf api-guide/build
sphinx-build -W -b html -d api-guide/build/doctrees api-guide/source api-guide/build/html
[testenv:api-ref] [testenv:api-ref]
description = description =
@ -198,15 +162,6 @@ commands =
rm -rf api-ref/build rm -rf api-ref/build
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
[testenv:placement-api-ref]
description =
Generate the Placement API ref. Called from CI scripts to test and publish to developer.openstack.org.
envdir = {toxworkdir}/docs
deps = {[testenv:docs]deps}
commands =
rm -rf placement-api-ref/build
sphinx-build -W -b html -d placement-api-ref/build/doctrees placement-api-ref/source placement-api-ref/build/html
[testenv:releasenotes] [testenv:releasenotes]
description = description =
Generate release notes. Generate release notes.
@ -220,7 +175,7 @@ commands =
# NOTE(browne): This is required for the integration test job of the bandit # NOTE(browne): This is required for the integration test job of the bandit
# project. Please do not remove. # project. Please do not remove.
envdir = {toxworkdir}/shared envdir = {toxworkdir}/shared
commands = bandit -r nova -x tests -n 5 -ll commands = bandit -r placement -x tests -n 5 -ll
[flake8] [flake8]
# E125 is deliberately excluded. See # E125 is deliberately excluded. See
@ -238,7 +193,7 @@ commands = bandit -r nova -x tests -n 5 -ll
# E251 Skipped due to https://github.com/jcrocholl/pep8/issues/301 # E251 Skipped due to https://github.com/jcrocholl/pep8/issues/301
enable-extensions = H106,H203,H904 enable-extensions = H106,H203,H904
ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,H405 ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,H405
exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,tools/xenserver*,releasenotes exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,releasenotes
# To get a list of functions that are more complex than 25, set max-complexity # To get a list of functions that are more complex than 25, set max-complexity
# to 25 and run 'tox -epep8'. # to 25 and run 'tox -epep8'.
# 34 is currently the most complex thing we have # 34 is currently the most complex thing we have
@ -246,8 +201,7 @@ exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,tools/xenserver*,release
max-complexity=35 max-complexity=35
[hacking] [hacking]
local-check-factory = nova.hacking.checks.factory import_exceptions = placement.i18n
import_exceptions = nova.i18n
[testenv:bindep] [testenv:bindep]
# Do not install any requirements. We want this to be fast and work even if # Do not install any requirements. We want this to be fast and work even if