From ab3db59c5aeac13f3998de09a2629e9fa52ec908 Mon Sep 17 00:00:00 2001 From: Ben Nemec Date: Thu, 6 Jun 2019 20:07:18 +0000 Subject: 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 --- pbr/tests/test_wsgi.py | 4 ++-- tox.ini | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pbr/tests/test_wsgi.py b/pbr/tests/test_wsgi.py index f840610..18732f7 100644 --- a/pbr/tests/test_wsgi.py +++ b/pbr/tests/test_wsgi.py @@ -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) diff --git a/tox.ini b/tox.ini index d029afc..bf7e5c8 100644 --- a/tox.ini +++ b/tox.ini @@ -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 -- cgit v1.2.1