Exemplo n.º 1
0
    def setUp(self):
        self.master = fakemaster.make_master(testcase=self, wantMq=True,
                                             wantData=True, wantDb=True)

        # set the slave port to a loopback address with unspecified
        # port
        self.pbmanager = self.master.pbmanager = pbmanager.PBManager()
        self.pbmanager.setServiceParent(self.master)

        self.buildslaves = self.master.buildslaves = bslavemanager.BuildslaveManager(self.master)
        self.buildslaves.setServiceParent(self.master)

        self.botmaster = botmaster.BotMaster(self.master)
        self.botmaster.setServiceParent(self.master)

        self.master.status = master.Status(self.master)
        self.master.botmaster = self.botmaster
        self.master.data.updates.buildslaveConfigured = lambda *a, **k: None
        yield self.master.startService()

        self.buildslave = None
        self.port = None
        self.slavebuildslave = None
        self.connector = None
        self._detach_deferreds = []

        # patch in our FakeBuilder for the regular Builder class
        self.patch(botmaster, 'Builder', FakeBuilder)
Exemplo n.º 2
0
    def create_child_services(self):
        # note that these are order-dependent.  If you get the order wrong,
        # you'll know it, as the master will fail to start.

        self.metrics = metrics.MetricLogObserver()
        self.metrics.setServiceParent(self)

        self.caches = cache.CacheManager()
        self.caches.setServiceParent(self)

        self.pbmanager = buildbot.pbmanager.PBManager()
        self.pbmanager.setServiceParent(self)

        self.buildslaves = bslavemanager.BuildslaveManager(self)
        self.buildslaves.setServiceParent(self)

        self.change_svc = ChangeManager(self)
        self.change_svc.setServiceParent(self)

        self.botmaster = BotMaster(self)
        self.botmaster.setServiceParent(self)

        self.scheduler_manager = SchedulerManager(self)
        self.scheduler_manager.setServiceParent(self)

        self.user_manager = UserManagerManager(self)
        self.user_manager.setServiceParent(self)

        self.db = dbconnector.DBConnector(self, self.basedir)
        self.db.setServiceParent(self)

        self.mq = mqconnector.MQConnector(self)
        self.mq.setServiceParent(self)

        self.data = dataconnector.DataConnector(self)
        self.data.setServiceParent(self)

        self.www = wwwservice.WWWService(self)
        self.www.setServiceParent(self)

        self.debug = debug.DebugServices(self)
        self.debug.setServiceParent(self)

        self.status = Status(self)
        self.status.setServiceParent(self)

        self.masterHouskeepingTimer = 0

        @defer.inlineCallbacks
        def heartbeat():
            if self.masterid is not None:
                yield self.data.updates.masterActive(name=self.name,
                                                     masterid=self.masterid)
            # force housekeeping once a day
            yield self.data.updates.expireMasters(
                (self.masterHouskeepingTimer % (24 * 60)) == 0)
            self.masterHouskeepingTimer += 1

        self.masterHeartbeatService = internet.TimerService(60, heartbeat)
        self.masterHeartbeatService.setServiceParent(self)
Exemplo n.º 3
0
    def setUp(self):
        self.master = fakemaster.make_master(testcase=self,
                                             wantMq=True,
                                             wantData=True)
        self.master.mq = self.master.mq
        self.buildslaves = bslavemanager.BuildslaveManager(self.master)
        # slaves expect a botmaster as well as a manager.
        self.botmaster = botmaster.BotMaster(self.master)
        self.master.botmaster = self.botmaster

        self.new_config = mock.Mock()
        self.buildslaves.startService()