Make WSGI tests listen on localhost

Currently we rely on the wsgi server to choose its own bind address,
which tends to result in it listening on a DNS name. This means we
have a dependency on that name resolving as expected on the node,
which seems to not always be the case.

In the interest of removing that environment dependency, let's have
the wsgi tests explicitly listen on 127.0.0.1, which should always
work and still allows us to verify our part of the WSGI functionality.

This also includes a fix to use constraints for building docs because
that is also blocking ci on this repo. We need both of these changes
for anything to merge without endless rechecks.

Change-Id: I48438eb31ee9dd102f06e30b13c6d892a93aba3b
Closes-Bug: 1830962
This commit is contained in:
Ben Nemec 2019-06-06 20:07:18 +00:00
parent c1e4225c5a
commit ab3db59c5a
2 changed files with 8 additions and 4 deletions

View File

@ -77,8 +77,8 @@ class TestWsgiScripts(base.BaseTestCase):
def _test_wsgi(self, cmd_name, output, extra_args=None):
cmd = os.path.join(self.temp_dir, 'bin', cmd_name)
print("Running %s -p 0" % cmd)
popen_cmd = [cmd, '-p', '0']
print("Running %s -p 0 -b 127.0.0.1" % cmd)
popen_cmd = [cmd, '-p', '0', '-b', '127.0.0.1']
if extra_args:
popen_cmd.extend(extra_args)

View File

@ -23,12 +23,16 @@ commands = flake8 {posargs}
[testenv:docs]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/doc/requirements.txt
commands = python setup.py build_sphinx
[testenv:releasenotes]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/doc/requirements.txt
commands =
rm -rf releasenotes/build
sphinx-build -W -b html -d releasenotes/build/doctrees releasenotes/source releasenotes/build/html