summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Nemec <bnemec@redhat.com>2019-06-06 20:07:18 +0000
committerBen Nemec <bnemec@redhat.com>2019-06-07 16:17:10 +0000
commitab3db59c5aeac13f3998de09a2629e9fa52ec908 (patch)
tree6976064303f2412e8fca075ea8faeec010a1e537
parentc1e4225c5a5b9917c62f84d3ae56e747e2758f69 (diff)
downloadpbr-ab3db59c5aeac13f3998de09a2629e9fa52ec908.tar.gz
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
-rw-r--r--pbr/tests/test_wsgi.py4
-rw-r--r--tox.ini8
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