Allow using webapp from connections
Allow connections to register their own handlers for HTTP URIs inside
the zuul's webapp HTTP server. That way, connections can listen for
events comming through HTTP.
Story: 2000774
Change-Id: Ic5887d00ff302f67469df5154e9df10b99f1cfcd
diff --git a/tests/base.py b/tests/base.py
index 9983103..6d3df8b 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -1367,6 +1367,9 @@
self.sched = zuul.scheduler.Scheduler(self.config)
+ self.webapp = zuul.webapp.WebApp(
+ self.sched, port=0, listen_address='127.0.0.1')
+
self.event_queues = [
self.sched.result_event_queue,
self.sched.trigger_event_queue,
@@ -1374,7 +1377,7 @@
]
self.configure_connections()
- self.sched.registerConnections(self.connections)
+ self.sched.registerConnections(self.connections, self.webapp)
def URLOpenerFactory(*args, **kw):
if isinstance(args[0], urllib.request.Request):
@@ -1414,8 +1417,6 @@
self.sched.setNodepool(self.nodepool)
self.sched.setZooKeeper(self.zk)
- self.webapp = zuul.webapp.WebApp(
- self.sched, port=0, listen_address='127.0.0.1')
self.rpc = zuul.rpclistener.RPCListener(self.config, self.sched)
self.sched.start()