Fix zuul-web sql connections

A recent change to scope sql connections to tenants was incorrect
because it assumed zuul-web would have access to a tenant's layout,
but that is only in the zuul-scheduler's memory.  Instead, this change
causes zuul-web to perform an RPC call to the scheduler to ask which
connection to use before performing sql queries.

This slipped through testing because the zuul web test fixture used
the same connection registry object as the scheduler, and therefore
*was* able to access data which normally would not be available to it.
This updates the zuul web test fixture to use a separate connection
registry.

Also, because zuul-web doesn't need any other kinds of connections at
the moment, add a facility to allow it to only load sql connections,
so that it doesn't do anything with the gerrit or github drivers.

Change-Id: Iac6d8c6960f4a31eb2f78511664b704758e41687
This commit is contained in:
James E. Blair
2018-06-04 13:55:59 -07:00
parent dc01c8f206
commit ac1bb06c45
11 changed files with 61 additions and 16 deletions

View File

@@ -827,7 +827,7 @@ class TestGithubWebhook(ZuulTestCase):
# Start the web server
self.web = self.useFixture(
ZuulWebFixture(self.gearman_server.port,
self.connections))
self.config))
host = '127.0.0.1'
# Wait until web server is started